Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java -version? 1

Status
Not open for further replies.

ksnpc

Technical User
Jan 23, 2004
91
US
I was asked to ensure that a user's java version was 1.5 or greater. I went to Java's test page and it reported 1.5.0_09, but when I typed java -version at the command prompt, it reported 1.3.1_01. I checked the Java control panel and it also reported 1.5.0_09. I was under the impression that these should report the same value. Which one of these is right or are they showing different things entirely? I've never really dealt with Java so I appreciate any advice.

Thanks,
Shauna
 
The java test page will check for your installation made known to the browser, perhaps configured somewhere and not using the path, while the command-prompt/shell is using the path.

On Linux you would use 'which java' to search for the first executable 'java' in the path.
On Windows, you will have to
Code:
 echo %PATH%
and iterate manually through all the possible parts of it.
I don't know for Mac, but I guess, 'which java' will work there too.

don't visit my homepage:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top