Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how can i know the verison of my java  RSS feed

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i get the information of java installation properites in mysystem..
and if there are 2 versions installed in my system (jdk1.4 and jdk1.5)
then how can i get both the version's installed in my system
can i get the program in java or otherwise suggest me which class should i need tot use to get the properties of the system.???(to know the version of java)
thanx in advance
cinux
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.System.getProperty("java.version")
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Type java -version on Command Prompt
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Chetan Parekh:
Type java -version on Command Prompt



I mean to ask about how to get thru programming code not on cmd promt


any way thanx
cinux
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Chetan said you can use:

System.out.println(java.lang.System.getProperty("java.version"));

it returns your java version.

You can install more than one jdk on your system, but as far as I know you can use only one at a time by setting the classpath of the one you wanted to work with.


cheers,
Su Yeu
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Su Yeu:
As Chetan said you can use:

System.out.println(java.lang.System.getProperty("java.version"));

it returns your java version.

You can install more than one jdk on your system, but as far as I know you can use only one at a time by setting the classpath of the one you wanted to work with.


cheers,
Su Yeu



The classpath has nothing to do with which version of Java that you use. However, setting the PATH will make it so you can easily run one of the installed versions by just typing the commands "javac" and "java". You can always type the complete path to run the version you wish at any time.

Layne
 
You showed up just in time for the waffles! And this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!