*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "paths" Watch "paths" New topic
Author

paths

zach
Greenhorn

Joined: Feb 01, 2002
Posts: 3
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

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


Dave
Cindy Glass
"The Hood"
Sheriff

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"
Sheriff

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
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

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

SCJP, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: paths
 
Similar Threads
Issues Compiling With Javac
Exception in thread "main" java.lang.NoClassDefFoundErorr: com/sun/tools/javac/Main
Java Beginner
hello world code
compiling problems