• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java -version

 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have downloaded "j2sdk1.4.2" and have included it in my "PATH".
So, here is what confuses me ---
**************************
"C:\echo %PATH%" gives me
"C:\j2sdk1.4.2\bin;......", so it seems jdk1.4 is there.
But, "C:\java -version" gives me
"java version 1.3.1, Java 2 Runtime environment, SE (build1.3.1)".
****************************
Why does "java -version" still show 1.3.1 instead of 1.4.2 ? I did a serach on 1.3 on my PC and I find that some other softwares on my PC (like bea7.0, VisualCafe) seem to use jdk1.3.1.
So, my questions are ---
1. what determines the output of "java -version" ? why doesn't it show 1.4.2 after I included 1.4.2\bin in my PATH ?
2. If I need to compile a code which includes some special method that are ONLY recognized by 1.4.2, will it work on my PC ? I guess it will because I have 1.4.2 in my PATH, but I am not sure because "java -version" still shows 1.3.1.
Please help.
Thanks,
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure there's a directory named, exactly, c:\j2sdk1.4.2? The directory may be named something like c:\j2sdk1.4.2_01, for example, or it may be located elsewhere.
 
Masha Klimenko
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must still have the old version on your computer. You have to uninstall 1.3 before installing 1.4, because if you put one over the other it won't work. (Also make sure CLASSPATH system variable is set)
 
Jeff Langr
author
Ranch Hand
Posts: 799
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.exe you are executing is probably located in your Windows system32 directory.
I suggest downloading a "which" utility--it will tell you the location of an executable being picked up by the path.
In any case, having multiple versions on Java on one machine can be tricky--best advice, as already suggested by someone else, is to uninstall other versions. You may also want to delete the java.exe in your system32 directory.
-Jeff-
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two sdk's on my laptop. I have 1.3.1_02 that was installed by Oracle and the other one I installed myself which is 1.4.1_01.
If you open a DOS prompt and type path, you can see in which order your sdk's are installed. On my laptop, Oracle likes to be listed first. If I wanted to, I could change the order of the path variable and move the path to the 1.4.1_01 sdk to the front of the list. In fact, Oracle's JDeveloper will let you tell it which sdk you want to use, which tells me that you can have more than one installed on your computer.
Also try this:

You will basically see your jvm properties.
 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, I correct that it should be j2sdk1.4.1_02 Now the
most critical question are ----
1. suppose I do NOT un-install anything, if I compile some code
that includes some method only recognized by 1.4.2, does it work ??
2. If I un-install, do I need to uninstall the softwares that
uses jdk1.3 ? That's not what I like because I still need to use
those softwares although they are bit old.
3. can I just simply delete that "system32" file without causing any side effect ?
 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leo donahue:
I have two sdk's on my laptop. I have 1.3.1_02 that was installed by Oracle and the other one I installed myself which is 1.4.1_01.
If you open a DOS prompt and type path, you can see in which order your sdk's are installed. On my laptop, Oracle likes to be listed first. If I wanted to, I could change the order of the path variable and move the path to the 1.4.1_01 sdk to the front of the list. In fact, Oracle's JDeveloper will let you tell it which sdk you want to use, which tells me that you can have more than one installed on your computer.
Also try this:

You will basically see your jvm properties.


so,
1. what do you get when you type "java -version" ?
2. do you have problem when you compile some code that's only compilable by 1.4 ?
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

so,
1. what do you get when you type "java -version" ?
2. do you have problem when you compile some code that's only compilable by 1.4 ?


When I type java -version? I get "java version 1.3.1_02"
I haven't really memorized what the differences are between 1.3 and 1.4 but so far, I have had no problems. I'm guessing here, but I suppose that since I have two paths to two different sdk's, if I need something for a program that is not in 1.3 but in 1.4, the jre will find the right sdk for me. I'm just guessing on that, I have no proof. But i would think that the JRE would look through the entire path variable before giving up.
[ February 05, 2004: Message edited by: leo donahue ]
 
Jeff Langr
author
Ranch Hand
Posts: 799
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leo donahue:
If you open a DOS prompt and type path, you can see in which order your sdk's are installed.

But remember that the windows system32 directory is usually first on the path, and usually will contain java.exe...
-J-
 
Jeff Langr
author
Ranch Hand
Posts: 799
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Sikuluzu:
3. can I just simply delete that "system32" file without causing any side effect ?

Yes. Windows will replace it if it needs to. But if you're feeling uncomfortable, just back it up.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic