File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Strange CLASSPATH Problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Strange CLASSPATH Problem..." Watch "Strange CLASSPATH Problem..." New topic

Strange CLASSPATH Problem...

Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 482
Hi Everyone,

I shifted to a new PC in office a week ago and I have installed JDK1.6 in the PC. But today when I started Eclipse I get the exception that Eclipse wont run with JDK1.4. The funny thing is my CLASSPATH and PATH variables are all set in the Advanced Options. Even echo %CLASSPATH% returns the JDK1.6 path. But when I run the command java -version I get the JDK1.4.

Here's what is set in the PC:


Could you guys tell me how to solve this so that i can get the Eclipse running.
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 482
Oh.. I solved it. There was a PATH variable in the System Variables section which was referencing to the JRE which came with Oracle which was JDK1.4.2. Deleted the JRE entry and it works now.

Thanks guys!
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
you can set you required java version by setting the preferences in eclipse.
Window->Preferences -->Java-->Installed JRE's
you can add here.

you can set the java path by setting the java home as a variable, the standard way of using is JAVA_HOME the value for this must be the root directory of your installed jdk.
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3902

Somnath Mallick wrote:

And, don't set the "CLASSPATH" to this at all, It should be "JAVA_HOME".

[How to ask questions] [Twitter]
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 482
I have JAVA_HOME set as well. When it wasn't working i looked up some guides. Where it was mentioned CLASSPATH. So i did set them as such. But i have JAVA_HOME set as well.
I agree. Here's the link:
subject: Strange CLASSPATH Problem...
It's not a secret anymore!