Page 1 of 2 12 LastLast
Results 1 to 20 of 22
  1. #1
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Java Compiler CMD Error

    Whenever I try to run "javac" in the cmd when trying to set up the Java Compiler, it always says the the command is invalid. I have set up the path correctly (i'm 100% sure of that), and even typed "cd C:\Windows\System32," but nothing when I type javac in the cmd. Can I get some help? Thanks!

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

    Default Re: Java Compiler CMD Error

    What exactly are you typing in? What exactly are you getting back?

    How do you know you set up the path correctly?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    I open CMD, type "cd C:\Windows\System32" and then type javac, and get back "'javac' is not recognized as an internal or external command, operable program or batch file." And I know I set up the path right because I copied the path from the most recent Java's bin folder, where "javac" is located, and put it in the Environment Variables. I did keep everything in the "path" and added it to that.

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

    Default Re: Java Compiler CMD Error

    Quote Originally Posted by SonicCore View Post
    Whenever I try to run "javac" in the cmd when trying to set up the Java Compiler, it always says the the command is invalid. I have set up the path correctly (i'm 100% sure of that), and even typed "cd C:\Windows\System32," but nothing when I type javac in the cmd. Can I get some help? Thanks!
    Your compiler is not in that directory (type "dir" in that directory and see for yourself); you have to add the directory, where your javac.exe file is stored, to your path variable.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    What do you mean type "dir" in that directory, like, what directory exactly and how? I'm kinda new to this kind of stuff, so sorry if i'm a bother.

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

    Default Re: Java Compiler CMD Error

    Quote Originally Posted by SonicCore View Post
    What do you mean type "dir" in that directory, like, what directory exactly and how? I'm kinda new to this kind of stuff, so sorry if i'm a bother.
    This directory: C:\Windows\System32; I bet your compiler (javac.exe) isn't there.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    You're right. But, how can I get it to work?

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

    Default Re: Java Compiler CMD Error

    Find where your javac.exe file is stored; add that directory to your path variable; normally that fle is stored in C:\Program Files\jdk<version>\bin where <version> is the version of your Java installation.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    That's what i've been doing, but I still get nothing.

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

    Default Re: Java Compiler CMD Error

    Quote Originally Posted by SonicCore View Post
    That's what i've been doing, but I still get nothing.
    Meticuously check for spaces in you path entry: no spaces except between "Program" and "Files"; not even before your path entry.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  11. #11
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    ";C:\Program Files\Java\jdk1.7.0_04\bin" That is what I have in the variable, the semi-colon being the end of the path before it.

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

    Default Re: Java Compiler CMD Error

    You can check if that directory is actually searched for an executable file by placing a simple .bat file there; e.g.

    Java Code:
    echo Yep, I'm here
    Check it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #13
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    Like I said before, i'm new to this. How would I check it?

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

    Default Re: Java Compiler CMD Error

    Reread my previous reply; I gave you a complete example.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    I know, I've made the file and placed it in the directory... but how do I check it?

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

    Default Re: Java Compiler CMD Error

    Suppose you named that file "foo.bat"; now type "foo" from the command line in any directory; does it print its echo line? (i.e. does it run?)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  17. #17
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    I named it test, and opened the cmd and typed "test" just like that. It's not a recognized internet or external command, program or batch file

  18. #18
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: Java Compiler CMD Error

    To see what the Path variable is set to, open a command prompt and enter: Path
    Copy the reuslts here.

    Here's what mine looks like:
    D:\JavaDevelopment\Testing>path
    PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\windows\syst
    em32;C:\windows;C:\windows\System32\Wbem;C:\window s\System32\WindowsPowerShell\v
    1.0\;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;C:\Program
    Files\Windows Live\Shared;C:\Program Files\WIDCOMM\Bluetooth Software\;c:\Progr
    am Files\Microsoft SQL Server\90\Tools\binn\;C:\Perl\site\bin;C:\Perl\bin ;d:\jav
    a\JMF21~1.1E\lib;

    D:\JavaDevelopment\Testing>
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    If you don't understand my response, don't ignore it, ask a question.

  19. #19
    SonicCore is offline Member
    Join Date
    Jun 2012
    Posts
    10
    Rep Power
    0

    Default Re: Java Compiler CMD Error

    C:\Users\Core Destroyer>Path
    PATH=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Com
    mon Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Micr
    osoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\windows\Sys tem32\Wbe
    m;C:\windows\System32\WindowsPowerShell\v1.0\;C:\P rogram Files (x86)\Windows Liv
    e\Shared;C:\Program Files (x86)\Pinnacle\Shared Files\;C:\Program Files (x86)\Pi
    nnacle\Shared Files\Filter\;C:\Program Files (x86)\QuickTime\QTSystem\C:\Program
    files (x86)\Java\jre6\bin";C:\Program Files (x86)\Microsoft SQL Server\100\Tool
    s\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\M
    icrosoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\QuickTime\QTSystem\;C:\
    Program Files\Java\jdk1.7.0_04\bin

    C:\Users\Core Destroyer>

    --------------------------------------------------

    There you go.

  20. #20
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: Java Compiler CMD Error

    That looks reasonable. What happens if you open a command prompt and enter:
    "C:\Program Files\Java\jdk1.7.0_04\bin\javac.exe"

    with the "s?
    If you don't understand my response, don't ignore it, ask a question.

Page 1 of 2 12 LastLast

Similar Threads

  1. Compiler error
    By Nikpatel in forum NetBeans
    Replies: 2
    Last Post: 04-26-2012, 09:39 AM
  2. Replies: 4
    Last Post: 04-23-2010, 01:54 PM
  3. java compiler error
    By arshesander in forum New To Java
    Replies: 7
    Last Post: 02-21-2010, 04:18 AM
  4. Replies: 8
    Last Post: 12-30-2009, 11:40 AM
  5. Replies: 3
    Last Post: 01-23-2009, 08:53 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
  •