Initially I was having one folder with name "jre1.6.0_02" under C:\Program Files\Java. At that time I dint have JDK on my machine. Then I have downloaded JDK 1.4.2_16 and installed it on my machine under the folder C:\j2sdk1.4.2_16. After installation, I have got one more folder with name "j2re1.4.2_16" under C:\Program Files\Java.
I opened command prompt, under direct c:\ column... I tried with the command "java -version" and its printing jre1.6.0_02.
On command prompt I ponted the directory to "C:\j2sdk1.4.2_16\bin" (here only I have installed JDK 1.4). now "java -version" command is printing j2re1.4.2_16.
Why its happening so?
Right now my system environmental variable PATH is pointing to C:\j2sdk1.4.2_16\bin.
which version of java I am using now... jre1.6.0_02 OR j2re1.4.2_16 ???
I would like to proceed with 1.4 ony, so where ever I go... c:\ or e:\ or C:\j2sdk1.4.2_16\bin .... if I type the command "java -version", it shuould say j2re1.4.2_16. what I need to do for this?
You need to put C:\j2sdk1.4.2_16\bin before any other path to a directory containing java.exe on your system. What is the complete contents of your PATH environment variable? Do you have a system and user variable PATH? (I think the system PATH is prepended.) Is there a java.exe in your Windows directory maybe? Just some things you could check.
HTH. [ October 25, 2007: Message edited by: Jan van Mansum ]
You need to put C:\j2sdk1.4.2_16\bin before any other path to a directory containing java.exe on your system
what do you mean here? I dint get, pls expalin clearly.
Thanks, Javardhan :
Jan van Mansum
posted 12 years ago
I meant that in the string assigned to PATH C:\j2sdk1.4.2_16\bin should appear before any other directory that contains a java.exe. When you type "java" in the console, Windows searches the PATH directories from left to right.
When you open a command prompt and type "java -version" it should say 1.4.2_16, unless there is a java.exe in C:\WINDOWS, etc of another version. Try making C:\j2sdk1.4.2_16\bin the first item in your path. If that doesn't work, I am afraid I can't explain what's happening.
SCJP 1.4, SCWCD 1.4
posted 12 years ago
Thank you Jan.
Your suggestion is working..
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad: