Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

How to check Java version?

Thread view: 
Mickey Segal - 12 Mar 2008 13:43 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
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.