Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

paths

 
zach
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dave Vick
Ranch Hand
Posts: 3244
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zach
Welcome to the Ranch, please review our naming policy and reregister.
Also, try the first cup of java tutorial to get some help setting up your paths the correct way.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jason Ford
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic