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 JDK problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JDK problems" Watch "JDK problems" New topic

JDK problems

mimi goh

Joined: Dec 10, 2001
Posts: 3
I can't get anything to compile...
This is the error I get...
Bad command or file name
I THINK my path is set correctly:
PATH C:\jdk1.3.1_01\bin;%PATH% ;.
SET CLASSPATH=C:\jdk1.3.1_01\bin;C:\jdk1.3.1_01\jre\bin;.
Can anyone help?!
omar khan
Ranch Hand

Joined: Feb 01, 2001
Posts: 183
Hi Mimi.
The error you get means that the DOS shell is unable to find the javac command.
Probably there is a misconfiguration of the path environment variable.
Try calling the compiler using all the path:
and tell me if there are improvements.

[This message has been edited by OMAR KHAN (edited December 13, 2001).]
mimi goh

Joined: Dec 10, 2001
Posts: 3
Is still doesn't work, here's my path:
PATH C:\jdk1.3.1_01\bin;%PATH% ;.
SET CLASSPATH=C:\jdk1.3.1_01\bin\javac;C:\jdk1.3.1_01\bin;C:\jdk1.3.1_01\jre\bin;.
if this is relevant, here's my version info:
C:\J21Work>java -version
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
Here's more detailed info on what's going on:
Volume in drive C has no label
Volume Serial Number is 1E73-1906
Directory of C:\J21Work
. <DIR> 12-10-01 10:06p .
.. <DIR> 12-10-01 10:06p ..
HELLOD~1 JAV 138 12-10-01 11:10p
HELLOD~1 CLA 440 12-10-01 11:16p HelloDan.class
HELLOW~1 JAV 153 12-10-01 11:20p
HELLOW~1 CLA 426 12-10-01 11:21p HelloWorld.class
PALIND~1 JAV 364 12-12-01 11:46p
PALIND~1 HTM 64 12-12-01 11:47p Palindrome.html
6 file(s) 1,585 bytes
2 dir(s) 855,638,016 bytes free
Bad command or file name
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Interesting that you got the java.exe program to execute in order to get the version information.
You seem to have spelled everything correctly. Do you have more than one version of java loaded on your machine? Are you using an IDE of any sort?

"JavaRanch, where the deer and the Certified play" - David O'Meara
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Just for kicks, when you type in: C:\J21Work>C:\jdk1.3.1_01\bin\javac what do you get?

If you still get Bad Command or file name, then javac has mysteriously disappeared from your system. You downloaded the jdk, and not just the jre, right?

Joined: Dec 17, 2001
Posts: 1
My Path looks like that:
SET PATH=C:\jdk13~1.1_0\bin\;.
SET CLASSPATH=C:\jdk13~1.1_0\src.jar;.
Maybe you have to use the dos-names...?
You shouldn't need any more paths except your working directory
which has to be in the CLASSPATH.
Anyway, if you are compiling your programs in a dos-shell the
only thing you got to do is making sure that the current directory is the one which includes your .java files.
type "javac -verbose *.java" and you should have at least one class file. If this doesn't work - remove and reinstall java.
But this should work because we both got the same system.
Good Luck!
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Please change your name to be compliant with JavaRanch's naming policy.
Your ID should be 2 separate names with more than 1 letter each. It should not be obviously fictitious. We really want this to be a professional forum and would prefer that you use your REAL name.
I agree. Here's the link:
subject: JDK problems
It's not a secret anymore!