Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes how to set classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to set classpath" Watch "how to set classpath" New topic
Author

how to set classpath

bharani rao
Ranch Hand

Joined: Apr 06, 2009
Posts: 164
hi,

i have just installed java ( jdk 6u12-windows-i586-p and jre 6u12-windows-i586-p)
i have installed in d:\program files\java\jdk1.6.0_12

now i set the classpath as .;D:\Program Files\Java\jdk1.6.0_12\bin; in system variables
there is also JAVA_PATH in system variables which is D:\Program Files\Java\jdk1.6.0_12\jre

i set the above 2 variables

the following is by default
QTJAVA which has value D:\lib\ext\QTJava.zip

in the user variables i have
JAVA_HOME D:\Program Files\Java\jdk1.6.0_12\bin;
PATH 3;D:\Program Files\Java\jdk1.6.0_12\bin;D:\Program Files\Java\jdk1.6.0_12\jre;

now when i run path java paths is not coming
is there anyother way to check and is the settings right??

i'm using windows 7 evaluation copy build 7100(RC)

thanks in advance










chen rui
Greenhorn

Joined: Aug 01, 2009
Posts: 3
do not use " " (space)

JAVA_HOME=your installation directory
path=%JAVA_HOME%\bin;%path%
classpath:directory which you want to run classes

it's OK


From China.I want to be toronto for working and living .
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
Do not set your CLASSPATH at all.
bharani rao
Ranch Hand

Joined: Apr 06, 2009
Posts: 164
hi,

it did not work

when i enter path or javac java path is not coming and javac is not recognised command

thanks in advance
chen rui
Greenhorn

Joined: Aug 01, 2009
Posts: 3
deleted
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
Nonsense.

And don't e-mail people

You have no need to set a classpath in the first place. Leave your Java installation in place. Read the installation instructions, particularly no 4 about setting your PATH. Do what it says to "set permanently." An incorrect path is characteristically recognised by a "javac is not recognized" error message. Find the Java™ Tutorials, and there is a "common problems" page in there.
bharani rao
Ranch Hand

Joined: Apr 06, 2009
Posts: 164
hi campbell,

it worked...
i removed the classpath as you suggested.....

now when i give path in command prompt it shows,
;D:\Program Files\Java\jdk1.6.0_12\bin;D:\Program Files\Java\jdk1.6.0_12\jre;
is this fine..

now i run the javac command, when i run it shows the list of options....


thank you very much..
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
You're welcome

If you go through the first part of the Java™ Tutorials you will find a "common problems" page, with a link to how to set the PATH permanently. You will probably do well to set your PATH permanently.
 
wood burning stoves
 
subject: how to set classpath
 
Similar Threads
JAVAC not found ??? I cant compile - help
how to set path for javafx and j2ee
Class file not being made
how to start eclipse
Assertion Doubt.