I can't get anything to compile... This is the error I get... C:\J21Work>javac HelloWorld.java 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?!
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: C:\jdk1.3.1_01\bin\javac and tell me if there are improvements.
[This message has been edited by OMAR KHAN (edited December 13, 2001).]
Joined: Dec 10, 2001
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: C:\J21Work>dir 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 HelloDan.java HELLOD~1 CLA 440 12-10-01 11:16p HelloDan.class HELLOW~1 JAV 153 12-10-01 11:20p HelloWorld.java HELLOW~1 CLA 426 12-10-01 11:21p HelloWorld.class PALIND~1 JAV 364 12-12-01 11:46p Palindrome.java 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 C:\J21Work>javac Palindrome.java Bad command or file name
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
Strange.... 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!
Joined: Sep 29, 2000
mr.mnemonic, 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. Thanks, Cindy