File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes paths Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "paths" Watch "paths" New topic



Joined: Feb 01, 2002
Posts: 3
This is driven me nuts!
I'm just tryin to get this 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 notepad file, under what directory. I have created a java folder and have the jdk folder within it.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
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"

Joined: Sep 29, 2000
Posts: 8521
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
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Oh, I missed the thing about your working .java files.
You can keep them anywhere. For instance you might create a sub-directory
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

Joined: Aug 02, 2001
Posts: 54
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 ]

I agree. Here's the link:
subject: paths
It's not a secret anymore!