This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java -version

 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic