• 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

How to set class path or whatever it is

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I ve just started with java and I m using jdk1.6.
While programming what I do is keep the java files in the bin directory(i.e. not a pretty good habit), so when i need to compile the prg, I just type the javac command followed by my class name; for that i first need to use the cd command to go to"C:\java...".

How can I avoid to go to bin for using java commands?
I ve heard that setting of sm classpath and smthing is required for that. How to do that?
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to Javaranch

http://java.sun.com/docs/books/tutorial/essential/environment/paths.html
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or read the faq.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Understand that the PATH and the CLASSPATH are two entirely different things.

When people resort to putting their own files in the Java bin directory, it's usually because they did not update their PATH variable when they installed Java, and this is the only way they've found to get files to compile. Updating your PATH will allow your system to find these Java tools regardless of what directly you're compiling from. See the link provided by Seetharaman for instructions on updating your PATH.

It's best to avoid setting a system CLASSPATH at all. (But if you do need a CLASSPATH, be certain it includes a dot (.) indicating the current directory.)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic