• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Information regarding Java versions

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Thanks,
Javardhan :
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Contents of the PATH variable:

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Wi
ndows Imaging\;C:\j2sdk1.4.2_16\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sy
stem32\Wbem;C:\Program Files\Windows Imaging\


I have java.exe file under the following directories:

C:\j2sdk1.4.2_16\bin
C:\j2sdk1.4.2_16\jre\bin
C:\Program Files\Java\j2re1.4.2_16\bin
C:\Program Files\Java\jre1.5.0_06\bin
C:\Program Files\Java\jre1.6.0_02\bin

You said:

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
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

In your case this is correct, if none of

C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\Program Files\Windows Imaging\

contains a version of java.exe.

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.
 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jan.

Your suggestion is working..
reply
    Bookmark Topic Watch Topic
  • New Topic