Results 1 to 13 of 13
Like Tree1Likes
  • 1 Post By pbrockway2

Thread: Javac Again, I know I know....

  1. #1
    Sparda is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Javac Again, I know I know....

    I am messing with a Java for dummies book, trying to get the Hello World program to run. I currently have JDK 7 installed on my computer, which is running Windows 7 64-bit. I have tried writing out the path exactly as it is in the
    Environmental Variables section, but I still get the error on the CMD Prompt. What can I be doing wrong?

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

    Default Re: Javac Again, I know I know....

    If you get an error, you'll want to show the complete error here.

    And welcome to the Java-Forums by the way!

  3. #3
    Sparda is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: Javac Again, I know I know....

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Sparda>javac HelloApp.java
    'javac' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\Sparda>javac HelloApp.java
    'javac' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\Sparda>

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

    Default Re: Javac Again, I know I know....

    Yeah, your system path is wrong and needs to include a path to the javac.exe file. Can you print out your current system path, and also show us the directory of your javac.exe file?

  5. #5
    Sparda is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: Javac Again, I know I know....

    .;C:\Program Files (x86)\Java\jdk1.7.0_01\bin;

    That is the path in the Environmental Variables Section. The javac.exe is located in...

    C:\Program Files (x86)\Java\jdl1.7.0_01\bin

    The file I am trying to access is located on my Desktop, written on Notepad. The path for that is...

    C:\Users\Sparda\Desktop\HelloApp.java

    Here is a screenshot of the CMD Prompt

    Javac Again, I know I know....-screenshot.jpg

  6. #6
    Sparda is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: Javac Again, I know I know....

    Bump for assistance

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

    Default Re: Javac Again, I know I know....

    Your system path and the path of the file don't appear match up.

  8. #8
    Sparda is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: Javac Again, I know I know....

    What do you mean exactly?

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

    Default Re: Javac Again, I know I know....

    In post #5 above, your path statement and your actual file path don't match, unless you've made a typographical error.

    Also, in the cmd window you'll want to test the system path by typing path at the prompt to see what is returned.

  10. #10
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Javac Again, I know I know....

    Also what you posted looks like a pretty abbreviated PATH setting. Are you sure you aren't confusing it with a setting you might have made for CLASSPATH?

    Your problem is the first mentioned on this page of Oracle's Tutorial. They give a link to the Win7 installation documentation for instructions on how to set the PATH variable. If you did set a CLASSPATH variable, unset it as it will do no good.
    ankiit likes this.

  11. #11
    Sparda is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: Javac Again, I know I know....

    I tried that and I still get the same error on the command prompt. This is what I have on my Path Variable:

    C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;

    And again, with no typos, this is the path from my C drive to the bin file on my JDK7:

    C:\Program Files (x86)\Java\jdk1.7.0_01\bin

    What do I need to type in the Path Variable to get this to work and recognized by the CMD Prompt?

  12. #12
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Javac Again, I know I know....

    What do I need to type in the Path Variable to get this to work and recognized by the CMD Prompt?
    Add

    C:\Program Files (x86)\Java\jdk1.7.0_01\bin

    to the Path variable so it reads

    C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Java\jdk1.7.0_01\bin

    Then open a new command window. This is what they were getting at in point (3) of what I linked to before. "Add the location of the bin folder of the JDK installation for the PATH variable in System Variables."

  13. #13
    Sparda is offline Member
    Join Date
    Jan 2012
    Posts
    7
    Rep Power
    0

    Default Re: Javac Again, I know I know....

    Finally started working. I don't know what I did wrong, but it is working now. I am not messing with it again unless necessary, thank you guys so much for your help!

Similar Threads

  1. help with javac
    By copy you in forum New To Java
    Replies: 8
    Last Post: 09-18-2011, 08:54 PM
  2. javac
    By Sephij in forum New To Java
    Replies: 9
    Last Post: 08-05-2011, 08:00 AM
  3. need help with javac
    By pawanmutalik in forum New To Java
    Replies: 10
    Last Post: 02-03-2011, 06:56 AM
  4. javac
    By PhilArmstrong in forum New To Java
    Replies: 31
    Last Post: 11-21-2009, 03:46 PM
  5. javac?
    By sardare in forum Eclipse
    Replies: 1
    Last Post: 06-14-2008, 02:06 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
  •