ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Boehle <>
Subject RE: [PATCH] - to detect JDK versions
Date Mon, 24 Jul 2000 14:39:31 GMT
Here is a link to the Java Product Versioning Spec if anyone is interested:

Jason Boehle

-----Original Message-----
From: Jesse Glick []
Sent: Monday, July 24, 2000 11:34 AM
Subject: Re: [PATCH] - to detect JDK versions

Tim Fennell wrote:
> First off, you're right. I'm not sure what I was going, but that code is
> whacked! About using int arithmatic though...Are we guaranteed that each
> version number will contain no leading zeros? If we are, then I'll
implement it
> with ints.  Otherwise I'll do as you suggest but parse each major/minor
> number to a double so I can deal with leading zeros appropriately.
Consider the
> (hypothetical) case:
>         1.4.1
>         1.4.02
> 1.4.1 should come first, but 02 will parseInt to 2 and make 1.4.02

I think the Java Versioning Specification is supposed to be used for
these numbers...that would specify a lexicographic Dewey-decimal-style
comparison, each segment by itself, and would treat 1.4.02 the same as
1.4.2. But beware: I have seen beta JDKs stick extra nonsense in there
such as "1.2beta" which screws things up. I sent a bug report to the JDC
complaining that they ought not use non-Dewey-decimal version numbers,
but to no apparent avail.

Anyway, comparisons should apply only to java.specification.version, not
java.version which is not guaranteed to be anything in particular other
than descriptive. For example in my VM all is well:

java.version: 1.3.0beta_refresh
java.specification.version: 1.3


Jesse Glick   <>
NetBeans, Open APIs  <>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR

View raw message