The simple answer used to be to check java.version or java.vm.version, but
the current JRE 1.6.0_05 reports both these values as 10.0-b19. I filed a
bug on similar behavior in JRE 1.7 (soon to appear at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6674346) but was
surprised to find that the problem extends back to JRE 1.6 as well.
How do the Java testers at http://www.java.com/en/download/help/testvm.xml
and http://www.javatester.org/version.html get the right answer despite this
bug?
Andrew Thompson - 12 Mar 2008 14:12 GMT
> The simple answer used to be to check java.version or java.vm.version, but
> the current JRE 1.6.0_05 reports both these values as 10.0-b19. I filed a
[quoted text clipped - 4 lines]
> andhttp://www.javatester.org/version.htmlget the right answer despite this
> bug?
Huhh? The makers of the second version checker
actually link to a page that shows the source,
and there is nothing special about it.
I tried their applet and recompiling the code
from the stated source and got the same answer of
'Java Version: 1.6.0 from Sun Microsystems Inc.'
for both the live applet and compiled code.
The command line says..
1.6.0-b105 (amongst other stuff, but for some
reason I cannot 'drage/select' text in the CLI
window of this machine I'm using).
For *major* version (if that is what interests
you) I would suggest using the technique I used
in the JavaVersionApplet. try/catches on
instantiating classes introduced in each
subsequent version, incrementing a counter
to keep track.
--
Andrew T.
Mickey Segal - 12 Mar 2008 16:14 GMT
Oops. Only java.vm.version is reporting wrong. java.version is reporting
correctly. In the past java.vm.version was useful for getting build
numbers.
I tried their applet and recompiling the code
from the stated source and got the same answer of
'Java Version: 1.6.0 from Sun Microsystems Inc.'
for both the live applet and compiled code.
Roedy Green - 13 Mar 2008 06:11 GMT
On Wed, 12 Mar 2008 08:43:53 -0400, "Mickey Segal"
<not_monitored@example.com> wrote, quoted or indirectly quoted someone
who said :
>The simple answer used to be to check java.version or java.vm.version, but
>the current JRE 1.6.0_05 reports both these values as 10.0-b19. I filed a
>bug on similar behavior in JRE 1.7 (soon to appear at
>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6674346) but was
>surprised to find that the problem extends back to JRE 1.6 as well.
see http://mindprod.com/applet/wassup.html
look over all the properties.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com