• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Classpath Understanding

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies.Yes i got it..
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic