Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

javac not recognized as an internal external command

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.



 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 75637
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never put your work into the program files directories. Your PATH entry should end with bin, as John Jai has told you.
 
Ranch Hand
Posts: 121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 75637
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Disagree. Unless you have problems you should forget about setting a system classpath.
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Campbell Ritchie
Marshal
Posts: 75637
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both methods for setting the PATH are valid. You sometimes need a JAVA_HOME for IDEs, but that is an advanced topic.
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic