This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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?
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.)
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org