This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This is driven me nuts! I'm just tryin to get this HelloWorld.java file to run and I keep getting errors. You set the PATH in the autoexec.bat, and where do you set the CLASSPATH, in dos or also in autoexec? Also where do I put my HelloWorld.java notepad file, under what directory. I have created a java folder and have the jdk folder within it. thanks ZJ
You can set them both in the autoexec.bat, or I just keep a .bat file around with the commands in them and run it on the fly. That allows me to switch which version of java that I am pointing to at any given time.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Sep 29, 2000
Oh, I missed the thing about your working .java files. You can keep them anywhere. For instance you might create a sub-directory c:\java\working; The dot reference in your classpath will allow the JVM to find your stuff if you are sitting in that directory when you compile or run, but if you put that working directory in your classpath then you could run from any other directory and the JVM will still find your class files.
zach, It is possible that the current value of your PATH variable is different than the value listed in your autoexec.bat. If you haven't restarted your computer since you made the changes to autoexec.bat, then your PATH will NOT have been updated. In Windows, to see what the current value of your PATH really is, open up a command prompt and type
Microsoft realized that this might be a problem for some users, so they designed Windows so that it will restart itself (read: crash) every day or so in order to update system variables. [ February 04, 2002: Message edited by: Jason Ford ]