Results 1 to 20 of 20
  1. #1
    Ricardo is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default 'javac' is not recongnised as an internal or external command - help!

    Hi!

    I'm new to Java. When I try to compile a program I get this message:

    'javac' is not recognized as an internal or external command, operable program or batch file.
    Before putting this question here, I searched for a solution and the majority of answers told me to put the path of Java JDK in the Environmental Variables - which I did.

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\;
    C:\Program Files\Intel\WiFi\bin\;
    C:\Program Files\Common Files\Intel\WirelessCommon\;
    C:\Program Files (x86)\QuickTime\QTSystem\;
    C:\Program Files\TortoiseSVN\bin;
    c:\MinGW\bin;
    C:\Program Files\Java\jdk1.7.0_03\bin;
    I really need this to work because of school and I have a work due on Sunday.

    Thanks.

  2. #2
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    291
    Rep Power
    4

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Try to navigate to that folder: C:\Program Files\Java\jdk1.7.0_03\bin; and then type javac to see if it works.
    Sorry, do this in cmd prompt..
    Last edited by milovan; 03-19-2012 at 02:05 PM. Reason: clarification

  3. #3
    Ricardo is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    It does.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    The PATH usually doesn't have newlines in it like that.
    Also ensure there's no extra spaces before the JDK path. That seems to cause lots of trouble.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    Ricardo is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    It doesn't have newlines. I just did it for better comprehension. There's just the one space between "Program" and "Files" and that cannot be avoided.

  6. #6
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    291
    Rep Power
    4

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Well, no idea. Try to add it once more...

  7. #7
    Ricardo is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    I seem to have found a temporary solution. If I put set path=%path%;"C:\Program Files\Java\jdk1.7.0_03\bin" in the command line, it works. But when I close it and open another one, it goes back to not working.

    Can someone help me find a permanent solution?

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Can you post the actual PATH as it appears, and not edit it.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    Ricardo is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Sure. Here goes.

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\TortoiseSVN\bin;c:\MinGW\bin; C:\Program Files\Java\jdk1.7.0_03\bin;

    Thanks.
    Last edited by Ricardo; 03-19-2012 at 02:28 PM.

  10. #10
    Join Date
    Apr 2010
    Location
    Warakapola, Sri Lanka
    Posts
    15
    Rep Power
    0

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    This isn't the way that setting the class path for javac.
    you have to edit the path environment variable and copy the path to the end of the line.
    Eg:-
    when you click on edit button after selecting path environment variable you should look something like this editable,

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\;

    you should copy the path of the bin directory to end of this line. like below,

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\;C:\Program Files\Java\jdk1.7.0_03\bin

    This is the way that I sat the class path.

  11. #11
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,839
    Rep Power
    8

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    I'd recommend posting your full path, without added new lines, with the code tags instead of quote tags. There are a couple things that look wrong with that path (extra spaces, weird characters, wrong case), and I don't know if they are actually problems or if they're just caused by incorrect copy-pasting.

    Edit- Way too slow, nevermind!
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Quote Originally Posted by Ricardo View Post
    Sure. Here goes.

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShel l\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\TortoiseSVN\bin;c:\MinGW\bin; C:\Program Files\Java\jdk1.7.0_03\bin;

    Thanks.
    There is a space at the beginning of that entry.
    That is what I was asking you to check for.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  13. #13
    noobplus's Avatar
    noobplus is offline Senior Member
    Join Date
    Feb 2012
    Location
    chennai,south of India(south east of asia)
    Posts
    232
    Rep Power
    3

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    type in cmd
    set path=%path%;C:\Program Files\Java\jdk1.7.0_03\bin
    then restart cmd
    then type "javac"

    thx
    dhilip

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    That set will only apply to the currentl open cmd window.
    When you close and reopen it is not "remembered".
    As the OP has already said in post #7.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  15. #15
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,305
    Blog Entries
    7
    Rep Power
    20

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Quote Originally Posted by noobplus View Post
    type in cmd
    set path=%path%;C:\Program Files\Java\jdk1.7.0_03\bin
    then restart cmd
    And then you'll notice that all your changes are gone ... as I wrote before: test your 'solutions' (mind the quotes) before you post them. You would've noticed that your last reply is rubbsh.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  16. #16
    noobplus's Avatar
    noobplus is offline Senior Member
    Join Date
    Feb 2012
    Location
    chennai,south of India(south east of asia)
    Posts
    232
    Rep Power
    3

    Cool Re: 'javac' is not recongnised as an internal or external command - help!

    Quote Originally Posted by JosAH View Post
    And then you'll notice that all your changes are gone ... as I wrote before: test your 'solutions' (mind the quotes) before you post them. You would've noticed that your last reply is rubbsh.

    kind regards,

    Jos
    hi,
    sorry yesterday, I had network problems, and I posted the last post 2 hours earlier.. and reloaded the page when net worked, so it got posted automatically, now im deleting that message.. and the space should be the mistake in the environmental variables

    regards
    dhilip

  17. #17
    Ricardo is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Problem solved! You were right. It was the space before the "C:\".

    Thank you so much!

  18. #18
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,751
    Rep Power
    19

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    Did you add that to the PATH, or was it done by the installer?
    I'm curious because we have had several of these recently for Windows 7.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  19. #19
    ozone is offline Member
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    can u plz help me as i am new to java...i have installed java version 1.7.and by default it got installed in the path you mentioned above.now when i try to compile java program.it says javac not recognised as internal or ext command.now i have checked the path and i was unable to find java.exe or javac.exe.what may be the path these files..plz help me.and on cmd when i try to know java_version.then no error comes.a small screen comes and then disappears.it happens same when i type java.exe .....plz suggest me what to do

  20. #20
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: 'javac' is not recongnised as an internal or external command - help!

    1. Use an uppercase letter at the start of each sentence and for the first person singular 'I'
    2. Use proper words: "Can you please" not "can u plz" / "internal or external command" not "internal or ext command"
    3. End a sentence with one period, followed by one or two spaces if not at the end of a paragraph.

    Express yourself more clearly:
    now i have checked the path and i was unable to find java.exe or javac.exe.
    Are you talking about the PATH system variable or the file path where you expected to find the executables? If the former, why did you expect to find executable file names in a system variable that contains the names of folders to be searched for files? If the latter, you haven't installed Java successfully.

    on cmd when i try to know java_version.then no error comes.a small screen comes and then disappears.
    The Windows "Run command" dialog isn't a command prompt window.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 25
    Last Post: 06-23-2012, 11:30 AM
  2. Replies: 12
    Last Post: 01-28-2012, 05:24 PM
  3. Replies: 1
    Last Post: 10-16-2011, 11:15 PM
  4. Replies: 28
    Last Post: 10-26-2010, 04:39 AM
  5. 'javac' is not recognized as an internal or external command
    By sam_1032002@btopenworld.c in forum New To Java
    Replies: 3
    Last Post: 10-18-2008, 02:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •