Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javac: invalid flag: Files\Java\jdk1.6.0_18;C:\Program

843789Feb 7 2010 — edited Feb 9 2010
Dear Experts,


Today, on Windows xp, I installed:
jdk-6u18-windows-i586.exe


I'm trying to do the simple business
of now running a simple program. The program
code DID work/run before on my old machine.
So, it's not the code.


I've changed the path, classpath, and java_path.


The symptom is:

cd C:\Program Files\Java\jdk1.6.0_18\bin

javac -classpath %classpath% C:\Notes\java\code2\Car.java

javac: invalid flag: Files\Java\jdk1.6.0_18;C:\Program
Usage: javac <options> <source files>
use -help for a list of possible options


javac -classpath %classpath%:. Car.java

javac: invalid flag: Files\Java\jdk1.6.0_18;C:\Program
Usage: javac <options> <source files>
use -help for a list of possible options



Here are the environment variables:


Path=
C:\Program Files\Java\jdk1.6.0_18\bin;C:\WINDOWS\system32;C:\ WINDOWS;C:\WINDOWS\System32\Wbem;
C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Sonic\MyDVD;C:\cygwin\bin;C:\cygwin\usr\bin; C:
\cygwin\usr\sbin;C:\cygwin\sbin


CLASSPATH=
.;C:\Program Files\Java\jdk1.6.0_18;C:\Program Files\Java\jdk1.6.0_18\bin;C:\Program Files
\Java\jdk1.6.0_18\lib;C:\Program Files\Java\jdk1.6.0_18\\src.zip;C:\Program Files\Java\jdk1.6.0_18\l
ib\dt.jar;C:\Program Files\Java\jdk1.6.0_18\demo\jfc\SwingApplet\SwingA pplet.jar;C:\Program Files\Qu
ickTime\QTSystem\QTJava.zip


java_path is:
C:\Program Files\Java\jdk1.6.0_18



Does anyone know the secret to fix this???

Could it have something to do with the blanks in
C:\program files
???

Sorry for the seemingly dumb questions.
But this kind of nonsense gets me every time.

Thanks a lot!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2010
Added on Feb 7 2010
8 comments
5,500 views