• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDK problems

 
mimi goh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?!
 
omar khan
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
mimi goh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just for kicks, when you type in: C:\J21Work>C:\jdk1.3.1_01\bin\javac Palindrome.java 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?
 
mr.mnemonic
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic