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 / May 2007

Tip: Looking for answers? Try searching our database.

How to determine Java version is at least 6?

Thread view: 
lemmi - 24 May 2007 10:41 GMT
Hi,

is there a way to check whether the Java version being used is AT
LEAST version 6? My application has a nice UI feature that is only
nice if Java 6 or higher is being used. Lower versions result in the
good old flickering behaviour. I know there is the "java.version"
system property but how can I efficiently check this ... depending on
the vendor it might have any kind of string in it, so I can't just
convert it to a float, right?

Dirk
Andrew Thompson - 24 May 2007 12:03 GMT
...
>is there a way to check whether the Java version being used is AT
>LEAST version 6?

No.  There are at least three.

>..My application has a nice UI feature that is only
>nice if Java 6 or higher is being used.

1) Web start - to handle versioning and possibly
prompt the user to upgrade if they have lower version.
<http://www.physci.org/jws/version.html>

2) try/catch.  Try to perform the behaviour (what is it?)
and if the method does not exist, the app. will throw
a NoSuchMethodError or similar.

3) java.specification.version *

>...Lower versions result in the
>good old flickering behaviour. I know there is the "java.version"
>system property but how can I efficiently check this ... depending on
>the vendor it might have any kind of string in it, so I can't just
>convert it to a float, right?

* Right, but there are a variety of other java properties
that might give better float results, like the aforementioned
j.spec.version, see some of them through the app. here..
<http://www.physci.org/jws/#jtest>
(dump all the properties to the command line - you
might find something better still)

HTH

Signature

Andrew Thompson
http://www.athompson.info/andrew/

lemmi - 24 May 2007 14:09 GMT
Thanks Andrew, I guess I will go with option 3 and do a
Float.parseFloat() on the
returned value for system property "java.specification.version".

BTW, the feature is simply a small animation that changes the size of
a top level Swing window, so that it seems to slide into its parent
window. With Java 5 you get a lot of flickering, which makes this
feature useless. It is supposed to be eye candy, so it better look
good.

Dirk

> ..
>
[quoted text clipped - 35 lines]
>
> Message posted viahttp://www.javakb.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.