• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding CLASSPATH  RSS feed

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi just i read somewere that
CLASSPATH is location of .class file of your application.

But i want to know if user has not yet compile his application that he'll not have any .class file(he'll only .java files).

Then what the CLASSPATH should be?

Please help me.

Thanks in Advance.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the general philosophy is that beginners shouldn't set a CLASSPATH at all.

Now, to answer your broader question, you can set it to where you .class files WILL BE.

the CLASSPATH is nothing more than a list of directories. When you run a java application, the Java Virtual Machine (basically) reads the CLASSPATH. Then, when it needs to find a .class file, it looks in all those directories until it finds the file it needs or runs out of places to look.

You can even have your CLASSPATH have directories that don't exist!!! the JVM doesn't care.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!