Big Moose Saloon
 Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies Register / Login

# I think I might've broken something... (Command line/PATH question)

Cody Czora
Greenhorn

Joined: Mar 26, 2009
Posts: 3
Hi everyone, I'm just getting back into Java after an AP CSci class in high school, only now with a command prompt instead of an IME, but problems ensued, and Head First Java doesn't really give much explanation in the matter.

Source directory: C:\Program Files\Java\jdk1.6.0_13\bin
File directory: C:\Users\Cody\Documents\Java\PP1.java
PATH: C:\Program Files\Java\jdk1.6.0_13\bin
CLASSPATH: C:\Program Files\Java\jdk1.6.0_13\bin

If I type:
C:\Users\Cody\Documents\Java>javac PP1.java

cmd gives me the "javac is not recognized as an internal or external command...etc" error, even though I'm pretty sure that I've set PATH correctly.

Is PATH wonky, or is it something fixed with a reboot?
Bartender

Joined: Jun 06, 2007
Posts: 2752

9

What is displayed when you type just path with no arguments and hit enter?

Secondly the CLASSPATH need not be set to the Java\bin directory, its supposed to be pointing to the directory where your application's required class files are stored.

And setting the path does not require a reboot. Reboot actually wipes it out.

SCJP, SCWCD.
Cody Czora
Greenhorn

Joined: Mar 26, 2009
Posts: 3
PATH is set to:
C:\Windows\System32; C:\Windows;...; C:\Program Files\QuickTime\QTSystem\
with no source dir, which is strange, as it's set properly through the Control Panel...

Thanks for the tip about rebooting; I wouldn't want to lose any of my last 2 hours of work.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3870

Cody Czora wrote:PATH is set to:
C:\Windows\System32; C:\Windows;...; C:\Program Files\QuickTime\QTSystem\
with no source dir, which is strange, as it's set properly through the Control Panel...

In that path somewhere does it points to bin directory in your JDK ? If not the path is not set. Also you need a new cmd prompt for the changes to take effect.

SCJP 5 | SCWCD 5