• 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to find the jdk version

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i find the jdk version being currently used in a system ? Assuming that a couple of versions are present in the system.
Would appreciate a response for the above.
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In command line type

It will give you the JDK version, JVM version and the JRE version of the JDK that will be used by default.

If you want to get it from your code, you can use

[ October 20, 2004: Message edited by: Mani Ram ]
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but if you run the command "java -version" in a bin directory of a particular JDK folder, you will get the version number of that JDK... But if you run it some other places, you will get the version of the default JDK, as Mani mentioned...

So you need to make sure where your command is running.... Just my 2 cents...
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what i got when i tried looking for the version.

C:\>javah -version
javah version "1.4.1_03"

C:\>java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

Which am i to interpret as the correct version ?
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by PNS Subramanian:

Which am i to interpret as the correct version ?



Everything
In your case,
JDK version is 1.4.2_05
JRE version is 1.4.2_05-b04
JVM version is 1.4.2_05-b04
javah version is 1.4.1_03
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want:

> javac -J-version
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by PNS Subramanian:
This is what i got when i tried looking for the version.

C:\>javah -version
javah version "1.4.1_03"

C:\>java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

Which am i to interpret as the correct version ?



This
C:\>java -version
java version [b]"1.4.2_05"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)[/b]
is the correct Java version that you are using...
javah is just a command to produce C header files and C source files from a Java class...

Hope it helps...
 
Hey cool! They got a blimp! But I have a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic