Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Classpath  RSS feed

 
Subodh Mantri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have set the path in the classpath,for my programmes to run on the command prompt on wondows environment.
Still everytime whenever I open the command prompt,I have to explicitly type the classpath on the prompt,in order to run the prog.successfully.
Otherwise I gives error such as noClassfound .etc etc
What could be the reason?
[ August 03, 2004: Message edited by: Subodh ]
 
Vijayendra V Rao
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using Windows, then why don't you try to set the CLASSPATH variable in the Enivironment Variables ? Set this variable there and re-start your system once. This worked for me so it has to definitely work for you too I think
 
Subodh Mantri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Initially I have already said that despite adding the path into the classpath variable in the systems menu in control panel,its not working !!!
 
Vijayendra V Rao
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just type set on the command prompt and check if the JAVA_HOME variable is correctly defined. Sometimes, the JAVA_HOME variable points to the wrong directory.

Also, just type javac on the command prompt and see if the system is recognizing it. If not, then set the JAVA_HOME variable properly and try.
 
Subodh Mantri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
To be specific ,I have to paths to be set ,one is where my programmes are written e.g. c:\xyz\*.java and another is my oraclediver.class file say c:\oracle\jdbc\classes.jar.
As per your suggestion,I hv type set on the command prompt and it does show
path= < the paths above are seen included in the list>
However classpath shows ..
classpath=c:\Program Files\Altova\....
Is this wrong ? I have specifically added abovesaid paths in the classpath variable in the environment.
The paths required for me are to be seen against the classpath or path ?
Please clarify.

subodh_mantri@dss.co.in
 
Subodh Mantri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hv found the solution.
It works only when you add the path in User variables and not the system variables.
Why is this ? In fact System vairiables should be setting the path irrespective of the user logged in.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you're confused by PATH and CLASSPATH.
They don't have to do anything with one another (beside being both system-variables).

The PATH is searched for executables - which includes java, javac, jar, etc.
The CLASSPATH is searched for classes (.class-Files).

And this is a beginners topic.
[ August 03, 2004: Message edited by: Stefan Wagner ]
 
Subodh Mantri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Mr.Stephen ,I am not at all confused.
I hv added the path in CLASSPATH variable ,but in the User variable section.
The said path was already added in the CLASSPATh variable in System variables section but had no impact on the working.
Its only when I added the same in User variable section in CLASSPATH ,my programmes have started working !
My Q is why is this ?
As per my knowledge goes adding in system variables has access to everybody.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Subodh,

Please change your displayed name to conform to JavaRanch's Naming Policy.

In your case please use a first name (or initial) followed by a family name which are not obviously fictional.

You may change your displayed name here.

Thank you
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Beginners forum...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!