File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Path & Classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Path & Classpath" Watch "Path & Classpath" New topic
Author

Path & Classpath

zach
Greenhorn

Joined: Feb 01, 2002
Posts: 3
I am extremely knew to all this, and I see someone has touched on this before but..
I'm trying to get the HelloWorld program to work, and I keep getting a bad command or file name error.
My autoexec looks like:
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\CDROM;C:\JDK1.3.1_02\BIN;C:\JDK1.3.1_02\JRE\BIN
My Classpath=c:\jkd1.3.1_02\lib;.;c:\java
I type in at the c:\java prompt "javac HelloWorld.java" and get that bad command error.
What am I doing wrong?
thanks
ZJ
Bhushan Jawle
Ranch Hand

Joined: Nov 22, 2001
Posts: 249
That error just means javac is not in your path, try including "your_jdk_directory\bin" in your path (where your_jdk_directory is susbtituted by appropriate path )
Regards,
Bhushan
zach
Greenhorn

Joined: Feb 01, 2002
Posts: 3
I don't understand, from the path that I showed above isn't the jdk directory\bin in my path already?
Does it have any correspondence to explorer, I have the jdk directory stored under folders c:\java\jdk...
What am I missing?
thanks
ZJ
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If you want to compile your path should point to the c:/java/jdk1.3.1_02/bin where the javac.exe program is stored. (I think that is where you said that you put it.) You will need to change all your classpath and path references to show that it is a directory lower than you are saying now.

Also zach,
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please re-register under an appropriate name as shown in the policy. Your display name should have two names separated by a space and not obviously fictitious.
Thanks again and we hope to see you around the ranch!!


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Path & Classpath
 
Similar Threads
Please Help----very urgent
problem whith installation Tomcat
Tomcat 4.0.1startup problem on Windows ME
Note able to run java program, urgent!!
Hello World