This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!