Version of JSDK?

How can I determine the version of JSDK in java code? Thanx
[73 byte] By [slho7] at [2007-9-26 2:25:23]
# 1
java -version
yuhuastones at 2007-6-29 9:36:24 > top of Java-index,Archived Forums,Java Programming...
# 2
Thanx for your reply.I wanna know if I can still get the version of the JSDK in java code segment, apart from getting it from command-line.
slho7 at 2007-6-29 9:36:24 > top of Java-index,Archived Forums,Java Programming...
# 3

Use the System property:

String s = System.getProperty("java.version")

This will return a string like "1.3.1"; this is the version of the JRE that you are running under. As far as I can tell, it works whether you are running from the command line, appletviewer, an IDE, or a browser (with or without the plug-in).

HTH,

Carl Rapson

rapson at 2007-6-29 9:36:24 > top of Java-index,Archived Forums,Java Programming...