Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java -version

 
Paul O'Neill
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't been active in Java in years so I forget EVERYTHING. I've downloaded the latest version to my PC but when I type 'java -version', I still see the old version. How do I change this? I changed my JAVA_HOME variable to point to my newly created folder.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've probably still got the location of the old JDK or JRE in your PATH. Modify that to make sure that either only the new JDK path is there or that it comes before the old ones if you can't get rid of them.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

As Keith suggested, the problem is probably your system PATH setting. The installation instructions should explain how to set this.
 
Paul O'Neill
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I've looked at the instructions. How do you tell if you're using 64-bit Windows or just 32-bit Windows?
 
Glen Ihrig
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right click My Computer and select "Properties".
Select the "General" tab.

If the System name does not contain "x64" or "64 bit" then you are running 32 bit windows.

64 bit windows is a high performance, usually server, operating system although there is a Windows XP Professional 64 bit. You would probably know if you had this.
[ March 15, 2007: Message edited by: Glen Ihrig ]
 
Paul O'Neill
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked up the Installation Instructions but none of it seemed to apply. I tried re-setting my Path and now when I do 'java -version' it's gone back to 1.3. I've removed all earlier Java references by Add/Remove Programs. I've changed the classpath. What am I missing? Where does 'java -version' get its information from?

Paul
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you open a command prompt and type SET, that will display all of your environment variables.

See what your PATH is.
 
Paul O'Neill
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I feel foolish. I had changed my path but I had one of the numbers wrong. I've fixed it, rebooted, and now the correct version is showing up.

Thanks!
 
Paul O'Neill
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On another server I'm looking at, the only java reference in the path is to d:\IBMJDK\bin. Does this mean the java -version is coming from something in this directory? I need to update the version on this server, so I assume I need to download a new jre and save it into the d:\IBMJDK folder.

Firstly, is the bin directory the jre??

Thanks for everyone's help on what I imagine is basic stuff.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15284
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"On another server I'm looking at, the only java reference in the path is to d:\IBMJDK\bin. Does this mean the java -version is coming from something in this directory?"

Most likely, yes. There could ofcourse be a java.exe in a different directory in the path (even a directory that is not obviously something that has to do with Java, such as C:\Windows\System32).

"I need to update the version on this server, so I assume I need to download a new jre and save it into the d:\IBMJDK folder."

Download the new version and follow the installation instructions - the instructions will tell you how you should install the new version and whether it is necessary to uninstall the old version first or not.

"Firstly, is the bin directory the jre??"

The JRE is part of the JDK. You can't really say "the bin directory is the JRE"; in the bin directory there are executables that are part of the JRE and there are executables (such as the Java compiler) that are part of the JDK.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic