| Author |
javac not recognized as an internal external command
|
vijay kaaman
Greenhorn
Joined: May 18, 2011
Posts: 5
|
|
Hi..
I am using windows 7.
JAVA_HOME and PATH environment variables set. "C:\Program Files\Java\jdk1.7.0_01"
on the following directory.."C:\SCWCD\beerV1\src\com\example\web\" there exists a file called BeerSelect.java
when I issue the javac command in the above directory as "javac BeerSelect.java"..I get the "javac not recognized as an internal external command.." error message. However, if I move the java file to the bin directory in "C:\Program Files\Java\jdk1.7.0_01", I do not get the javac not recognized error.
Can someone help me with this?
THank you.
|
 |
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
|
|
|
Did you open a new cmd prompt after setting the PATH variable under the System Variables? Note that PATH should point to the bin directory of the Java 7 installation folder and better append it in the beginning of the PATH configuration.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
|
Never put your work into the program files directories. Your PATH entry should end with bin, as John Jai has told you.
|
 |
Rodrigo Lopes
Ranch Hand
Joined: Feb 29, 2008
Posts: 118
|
|
set JAVA_HOME="C:\Program Files\Java\jdk1.7.0_01" and PATH=%PATH%;%JAVA_HOME%\bin
and don't forget to also set CLASSPATH=.;%JAVA_HOME%\lib (at least)
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
|
Disagree. Unless you have problems you should forget about setting a system classpath.
|
 |
Hebert Coelho
Ranch Hand
Joined: Jul 14, 2010
Posts: 754
|
|
Usually i just set the PATH with the bin folder of the Java instalation.
Something like: "C:\Program Files\Java\jdk1.7.0_01\bin"
You would not need the JAVA_HOME
|
[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
|
Both methods for setting the PATH are valid. You sometimes need a JAVA_HOME for IDEs, but that is an advanced topic.
|
 |
 |
|
|
subject: javac not recognized as an internal external command
|
|
|