aspose file tools*
The moose likes Java in General and the fly likes java -version Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java -version" Watch "java -version" New topic
Author

java -version

leo donahue
Ranch Hand

Joined: Apr 17, 2003
Posts: 327
Is it safe to assume that if you have two different jdk's installed (thanks to Oracle) that when you issue a command such as:
java -version
at the DOS prompt, that the first jdk referenced in the classpath will be the one which is used?
Oracle installed jdk 1.3.1 at the beginning of my classpath variable and this is why I'm assuming I get 1.3.1 when I issue java -version
Which by the way the jdk 1.3.1 doesn't even show up in my control panel under Add/Remove programs. What's up with that?


Thanks, leo
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

java -version will run whichever is first in your PATH, not your CLASSPATH -- the latter will be used by whichever JDK Windows chooses to execute, but it's up to Windows to choose one (and it will use PATH to do so.)
Regarding the add/remove: it's perfectly possible to simply copy the JDK files onto a computer where they'll work fine, without having made any registry entries, so they won't show up in add/remove.


[Jess in Action][AskingGoodQuestions]
 
Don't get me started about those stupid light bulbs.
 
subject: java -version
 
Similar Threads
showing wrong jre
MQJMS1046: The character set Cp437 is not supported
Determine which jdk version for tomcat
Cant use java to execute files
Uninstalling java on linux