Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classpath Understanding

 
Nittin singla
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know the meaning of :. in classpath. Also i want to know, what to i need to set my classpath if i want to get the class files generated in the same folder where java files are present.

TIA


 
Rameshwar Soni
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to me CLASSPATH is nothing but telling java where it should find the class file which you have created after successful compilation of java source file.
Now to set the CLASSPATH all that you have to write on the command prompt is set CLASSPATH=path of the folder where your class file is located.
Example... Suppose i save all my .java(dot java i.e. java source file) and .class(dot class file) in My_Java folder which is present in C drive i.e. C:\My_Java.
. So i would write this on command prompt set CLASSPATH=c:\My_Java;.
.
.
Now the one which was done above was temporary i.e. once you close your command prompt you would have to set the CLASSPATH again. SO the permanent solution is
Right click on My Computer>Properties>Advanced tab>Environment variable> and set your CLASSPATH in system variables.
. I hope you are using Windows OS
 
fred rosenberger
lowercase baba
Bartender
Posts: 12266
36
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the dot means "the current directory" - basically, the directory you are in when you type "java classname"
 
Nittin singla
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies.Yes i got it..
 
Campbell Ritchie
Sheriff
Posts: 51450
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beware of classpaths; you can do lots more harm than good with them. Especially: avoid setting a system classpath if at all possible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic