File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Java version Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java version" Watch "Java version" New topic
Author

Java version

Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 230

Hi Ranchers,
I have both JDK1.3 and J2SDK1.4.1_02 installed on my machine. Notice the following copied from my command window:

Can you tell me why this happens? My machine seems to take jdk1.3 version of Java as default. My CLASSPATH environment variable reads as follows:

Has it got to do with the registry settings?
[ March 31, 2003: Message edited by: Barry Gaunt ]

Debashish
SCJP2, SCWCD 1.4, PMP, ITIL Foundation
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
I think it does have to do with registry settings, but I'm rusty with the issues. Do you really need both versions on your computer?
If no one else gives you better advice, I'd recommend uninstalling both. Then installing 1.4 first, and 1.3 second (only if needed).
--Mark
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Check your PATH (not CLASSPATH) environment variable with echo %PATH%. See if the 1.3.0 compiler bin directory is before the c:\j2sdk1.4.1_02\bin directory. If it is, then remove it.
It's a good idea to have a JAVA_HOME variable set to C:\j2sdk1.4.1_02 and use it in both your PATH and CLASSPATH.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
As Mark said, I believe that Sun's install notes say you should deinstall any previous version before installing 1.4.1_02.
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 230

Thanks for the replies.
I needed j2sdk1.4.1 for testing purpose and since my version of Netbeans IDE doesn't run without jdk1.3 I had to retain the older version too. My Classpath and Path env.variables do not contain any reference to the old JDK.
Anyway, I do agree it's not logical to have both the versions on my machine. I was just curious to know why such result should come (see my first post in this thread). And how the versions were being judged..I am still sure this must be the registry thing.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You could search for all the java.exe files and see whether their directories are on the PATH. If you put the %JAVA_HOME%\bin (JAVA_HOME = c:\j2sdk1.4.1_02) in the front of your PATH that should at least enable the correct executables to be used.
-Cheers Barry
[ March 31, 2003: Message edited by: Barry Gaunt ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java version