Results 1 to 14 of 14
  1. #1
    tsaund is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default javac is not recognized as an internal or external command... and vista

    Hi everyone and thank you to anyone who tries to help me with this problem.

    I know that the above is a common problem because I have read a lot of threads discussing it. I also know that the problem lies with the environment variables and the path of my JDK. I followed the instructions at Sun and I went to the environment variables, found the system one called path [which matched what I expected to see] and added my path to my JDK at the end.

    My Path is: C:"\Program Files\Java\jdk1.6.0_11\bin

    Needless to say it didn't work. Since I knew the path was right I tried it at the beginning of the path list and followed some instructions I found to enter it using the c prompt but still no.

    If I type "java -version" it returns the expected result but if I try the same with "javac -version" it returns the error message, so the programme is there but javac won't work. Added to this if I ask the computer to search for the file "javac" it cannot find it eventhough the javac file is definitely in the bin folder.

    Any help would be appreciated and I can supply any other information you need.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Is that quote symbol in your path statement a forum typo?

    You may want to paste your entire system's path string here.

    Also, I recommend that you open up windows explorer, go to the C:\Program Files\Java directory and search for javac.exe to see exactly where it's located.

  3. #3
    Hatchet is offline Member
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Default javac............................................. ......

    I am Having the same problem with the jdk1.6.0_11 only on the xp operating system.

    My PATH in envirn variables is:
    C:\Program Files\PC Connectivity Solution\;%SystemRoot%\system32;%SystemRoot%;%Syst emRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Samsung\Samsung PC Studio 3\;C:\Program Files\Java\jdk1.6.0_11\bin;

    and my javac is in the bin directory.

    i also changed the directory in comand prompt to where my source file are stored and even typed dir into that directory and the source files are showing please help as this is part of my course.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    What happens exactly if you type
    Java Code:
    javac -version
    from the command line? What is the full error message?

  5. #5
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    sometimes the env can be too long. (happened to me once)

    * ONLY TEMPORARY, FOR EVALUATION PURPOSES
    try this. pop open a command prompt and type:
    Java Code:
    C:\>
    C:\>PATH=C:\Program Files\Java\jdk1.6.0_11\bin
    
    C:\>echo %path%
    C:\Program Files\Java\jdk1.6.0_11\bin
    
    C:\>javac -version
    javac 1.6.0_11
    
    C:\>
    * IF THIS WORKED, read the follow up message posted below.
    Last edited by angryboy; 01-26-2009 at 07:42 PM.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  6. #6
    tsaund is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default

    First of all thank you very much to everyone who has tried t help.

    To answer people's questions:
    -the quotation mark was a typo by me sorry, I know that this can affect things
    -my full system path is: C:\Program Files\Java\jdk1.6.0_11\bin;%SystemRoot%\system32;% SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1 \COMMON~1\ULEADS~1\MPEG;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\QuickTime\QTSystem\
    -the application javac is in the folder C:\Program Files\Java\jdk1.6.0_11\bin because I can see it but my search facility on my computer says it cannot find a file called javac
    -the full error message is "javac" is not recognized as an internal or external command, operable program or batch file
    -I tried Angry boy's idea and got the computer to return what I would expect for the "javac -version" command but it still wouldn't compile when I then tried to do the Hello World exercise [got the above error message again]

    I hope that this can help someone help me and thanks again.

  7. #7
    Hatchet is offline Member
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Default

    thanks you that has helped alot

  8. #8
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    -I tried Angry boy's idea and got the computer to return what I would expect for the "javac -version" command but it still wouldn't compile when I then tried to do the Hello World exercise [got the above error message again]
    my suggestion was only temporary, to test out if your env was too long. when you closed the cmd, it resets to the original path. in other words, you need to do that everytime you want to run javac.

    there are two ways to over come this,
    1) shorten your env-var.
    2) write a batch file and put it in c:\windows\system32
    Java Code:
    rem batch filename = [B]javac.bat[/B]
    "C:\Program Files\Java\jdk1.6.0_11\bin\javac.exe" %*
    If java.exe also don't work, here's the batch file for it.
    Java Code:
    rem batch filename = [B]java.bat[/B]
    "C:\Program Files\Java\jdk1.6.0_11\bin\java.exe" %*
    3) If all else fails, (this is kinda ghetto...) Drag-And-Drop file.java to javac.exe.
    Last edited by angryboy; 02-04-2009 at 08:47 AM.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  9. #9
    tsaund is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default

    Sorry for the delay in replying, I've been away.

    Thank you so much for your help especially Angry Boy.

    I shortened my Path and put in the batchfile and whilst it does some new things it is
    still not compiling even the simple HelloWorldApp. Someone told me that I might be better off with NetBeans so i'm going to try that although i'll still be trying to do the same thing, but still.

    Thank you again.

  10. #10
    tom
    tom is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default

    ok i dont get wat to that does so can u help me.

    'java' is not reconized as internal or external command

  11. #11
    Hatchet is offline Member
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Default

    ok i know its a bit off topic but i can't seem to find a solution for this problem.

    i typed the following into comand prompt and this is what came up.

    javac Hello.java
    Hello.java:5: package system does not exist
    system.out.println("Hello World");
    ^
    1 error

    what does this mean and how do i fix it?

    Thank you.

  12. #12
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    6

    Default

    please, post new and unrelated questions in a new topic. anyways...

    part of the fun of java is familiarizing yourself with the errors:

    the error "package system does not exist" means that the indicated package, in this case "system", simply does not exist. if you do not know about packages, read up on them in a tutorial (which are fairly abundant). it's a fairly straight-forward concept, but a little lengthy to explain in a post.

    and you can see the nice carrot pointing to "system" in the erroneous line. usually, it's obvious what is causing the error, but when you have a billion (or even just 2) things going on in a line, it can get confusing.

    anyways, "system" should be capitalized as "System". simple typo needing fixing.

  13. #13
    Hatchet is offline Member
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Default

    thank u very much it always the things in front of ur nose u can't seem to find...ill also take the "new Topic" on board thanks again.

  14. #14
    HelloRick is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default

    Quote Originally Posted by angryboy View Post
    my suggestion was only temporary, to test out if your env was too long. when you closed the cmd, it resets to the original path. in other words, you need to do that everytime you want to run javac.

    there are two ways to over come this,
    1) shorten your env-var.
    2) write a batch file and put it in c:\windows\system32
    Java Code:
    rem batch filename = [B]javac.bat[/B]
    "C:\Program Files\Java\jdk1.6.0_11\bin\javac.exe" %*
    Please give the complete step how to implement this? Should I just save the javac.bat at the path? What will I write at the env-var?

Similar Threads

  1. Replies: 28
    Last Post: 10-26-2010, 04:39 AM
  2. javac command not recognized
    By sunshine39 in forum New To Java
    Replies: 7
    Last Post: 03-04-2009, 03:54 AM
  3. Replies: 8
    Last Post: 11-18-2008, 09:21 AM
  4. '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
  5. Replies: 6
    Last Post: 07-30-2008, 03:50 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
  •