‘javac’ is not recognized as an internal or external command


1. Go to http://java.sun.com and download the latest Version of Java SDK or any Jave SDK that your requirement and install on your system.

2. Accept all of the defaults and suggestions, but make sure that the location where Java will be installed is at the top level of your C: drive.
Click on “Finish.” You should have a directory (folder) named C:\j2sdk1.5.0_04, with subfolders C:\j2sdk1.5.0_04\bin and C:\j2sdk1.5.0_04\lib

3. Modify your system variable called “PATH” (so that programs can find where Java is located).
To do this for Windows 2000 or XP, either right-click on the My Computer icon or select “System” on the control panel.
When the window titled “System Properties” appears, choose the tab at the top named “Advanced.”
Then, click on “Environment Variables.”
In the bottom window that shows system variables, select “Path” and then click on “Edit…” Add C:\j2sdk1.5.0_04\bin as the first item in the list.
Note that all items are separated by a semicolon, with no spaces around the semicolon. You should end up with a path variable that looks something like
C:\j2sdk1.5.0_04\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\Wbem

For Windows 98 or ME, open the file AUTOEXEC.BAT in Notepad. You should find a line in this file that begins
SET PATH=…
Modify this line to add C:\j2sdk1.5.0_04\bin; immediately after the equals sign.

4. Modify or create a system variable called “CLASSPATH,” as follows.
In the lower “System Variables” pane choose “New…”
and type in Variable Name “CLASSPATH” and value (note that it begins with dot semicolon).;C:\j2sdk1.5.0_04\lib

5. To test Java to see if everything is installed properly, open a command window (a DOS window)
and type the command “javac” The result should be information about the Usage of javac and its options.
If you get a result that “‘javac’ is not recognized as an internal or external command, operable program or batch file” then there is a problem
and Java will not work correctly.

About these ads

35 Responses

  1. its great, thanks

  2. Thank you a lot, You explain it so clear, I have been to other forum and it didnt work, I come here and in 3 min I fix the problem, thank you

    akab

  3. clean and works..

    Add a point..if u open a CMD,,,after doing the steps u need to close it..then only can recoganise the comand!

    Cheers,,

  4. can you add me to msn mine not working add g-unit62@Live.ca

  5. dude, finnaly i found something that works, thanks so very much :)

  6. C:\Program Files\Java\jre6\bin….i have the same problem..there is no version showing in path…n there is no javc in bin folder..what is the problem .??plz help me out???

  7. C:\Program Files\Java\jre6\bin….i have the same problem..there is no version showing in path…n there is no javc in bin folder..what is the problem .??plz help me out???

    • its not the right version of java you are using. it should be jdk not jre. try downloading it in oracle..name is java SE

  8. if you install jdk, you can have javac in /bin

  9. it not work for me I have new version the path is C:\Program Files\Java\jdk1.6.0_11\lib so it will work tel me plsssssss

    • it’s in “\bin” not “\lib”

      C:\Documents and Settings\wi>cd C:\Program Files\Java\jdk1.6.0_14\bin

      C:\Program Files\Java\jdk1.6.0_14\bin>javac -version
      javac 1.6.0_14

  10. Fentastic answers.

    I follwed the steps above ,Now i can able to compile and run my java program in cmd.

    Reference:
    Path=C:\Sun\SDK\jdk\bin;
    classpath=C:\Sun\SDK\jdk\lib;

    Regards,
    S.Praveen

  11. okay ive done everything said and i tested javac and it works but now it cant find my .java file.

    ive tried saving it to numerous places, ive tried setting the path in cmd, ive basically tried every suggestion ive found on here but it still cant find it….

    any more suggestions would be greatly appreciated…

    -Yankee

  12. Hey thanks. i visited other forums and i couldn’t find the solution. But here, i got the complete solution. Now i can run any java program on my PC. THANKS.

  13. C:\Program Files\Java\jre6\bin….i have the same problem..there is no version showing in path…n there is no javac in bin folder..what is the problem…i tried all d suggestions but its not working .??plz help me out???

  14. Thanks Man you are a life saver I was finding this method thanks man

  15. Your instructions for Xp are all over the place. When I finally interpereted them, it didn’t work anyway.

  16. Hi,
    Great work which simply gives us the procedure for setting variable for java programmers and lovers.

  17. thanks man
    you explain it fluently
    really thanks

  18. same isse I am having. And i am taking a Java Programming class at college so I have to get Java to work properly.

  19. Ive been having the same issue, I haven’t tried the solution I am about to propose yet but it just popped in my head a few minutes ago.
    I see many of you are creating the path to jre6.
    I believe jre6 is just the runtime environment part of the jdk install. If there is another directory in your java folder i.e. \jdk1.6.0_14 try setting the path to the bin sub directory in that folder

  20. i hav installed java…dont have any idea about java…just started learning java…. now when i run cmd….after a couple of commands when i type javac they say ” javac is not recognised as an internal or external command…can any one help me plss

  21. lovly place ths is…..it worked really well…..

  22. thanks a lot ….
    worked and understood nicely !

  23. Thanx a lot

  24. thanks, worked straight-up yo. must have been the /bin and /lib addition, those were the only things I changed.

  25. I can’t get Java to run the javac Hello.java, I followed everything you said, but I get the error on the last step saying that: If you get a result that “‘javac’ is not recognized as an internal or external command, operable program or batch file” then there is a problem
    and Java will not work correctly……please HELP ME, I have a class and I need to get my work done, I am at Lchris292002@yahoo.com is someone can help me, thanks.

    Leslie

  26. I’m not sure what you mean by the “top level of the C drive”.
    I installed in C:\Program Files\Java\jre7
    Both the bin and lib sub-directories are installed underneath jre7.
    Do I need to move jre7 above “Program Files” on the C drive?
    Thanks in advance

  27. You stopped explaining right where I am having the problem… I have correctly installed everything, so why is javac not recognized?

  28. jre is run time environment –>if you have only jre you can only run your class files i.e you cannot compile any java class on your machine.

    JDK–>it’s a development kit which contains compiler as well as runtime environment .in this you can compile & run your java classes

  29. thanku very much.. :)

  30. Perfect solution. Clear and straight-forward.

    Thank you.

  31. Thank you so much :), I didn’t even need to set JDK directory under C: it was under C:\Program Files (x86)

  32. Hi,

    I installed JDK jdk1.7.0_02. Set the same path in system variables.
    Path = C:\Program Files\Java\jdk1.7.0_02\bin
    CLASSPATH = .;C:\Program Files\Java\jdk1.7.0_02\lib
    but if i try from javac in command prompt it shows “javac is not recognized as an internal or external command operable program or batch file ”
    I am working on windows 7.
    Please do let me correct if i am doing something wrong.

    Thanks in advacnce
    Mahesh

  33. THANK YOU

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 43 other followers

%d bloggers like this: