Results 1 to 8 of 8
  1. #1
    java1337 is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default Updating PATH (javac)

    According to this website: Javanotes 6.0, Section 2.6 -- Programming Environments, it says
    The most basic commands for using Java on the command line are javac and java; javac is used to compile Java source code, and java is used to run Java stand-alone applications. If a JDK is correctly installed on your computer, it should recognize these commands when you type them in on the command line. Try typing the commands java -version and javac -version which should tell you which version of Java is installed. If you get a message such as "Command not found," then Java is not correctly installed. If the "java" command works, but "javac" does not, it means that a Java Runtime is installed rather than a Development Kit.
    So I went to section 4 here: Installation Notes

    My bin directory is C:\Program Files\Java\jdk1.6.0_26\bin

    However, I get confused when I get to the PATH for User Variables and System Variables.
    My computer says that the PATH User Variable is currently %CommonProgramFiles%\Microsoft Shared\Windows Live
    and the PATH System Variable is currently %CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files\MiKTeX 2.7\miktex\bin;%SystemRoot%\system32;%SystemRoot%; %SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;%SYSTEMROOT%\System32\Wi ndowsPowerShell\v1.0\

    Could someone please help me with where I'm supposed to type the bin directory address?

    Thanks in advance! Sorry I'm new to Java so I'm really confused.
    Last edited by java1337; 06-19-2011 at 08:53 PM.

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

    Default

    I'm guessing yours is a Windows system? You would edit the path, add a semicolon to the end of it and append your Java's bin path to the end.

    So your new path would be something like:

    %CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files\MiKTeX 2.7\miktex\bin;%SystemRoot%\system32;%SystemRoot%; %SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;%SYSTEMROOT%\System32\Wi ndowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_26\bin

  3. #3
    java1337 is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default

    Yes, I have Windows Vista 32-bit. I tried what you suggested above, for both the User Variable and System Variable. I added a semicolon at the end and pasted the bin address. However, when I type "javac -version" in my command prompt, I get command not recognized. "java -version" works fine though.

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

    Default

    Open Windows Explorer and check whether you have a file javac.exe in the bin directory.

    db

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,609
    Rep Power
    23

    Default

    Can you show us your current environment variable setting? Open a command prompt, enter: Set
    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.

  6. #6
    java1337 is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default

    Yes, there is javac.exe in the bin directory.

    After typing Set in command prompt:

    Microsoft Windows [Version 6.0.6002]
    Copyright (c) 2006 Microsoft Corporation. All rights reserved.

    C:\Users\NAME>Set
    ALLUSERSPROFILE=C:\ProgramData
    APPDATA=C:\Users\NAME\AppData\Roaming
    asl.log=Destination=file
    CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=PC
    ComSpec=C:\Windows\system32\cmd.exe
    DFSTRACINGON=FALSE
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Users\NAME
    LOCALAPPDATA=C:\Users\NAME\AppData\Local
    LOGONSERVER=\\PC
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files\MiKTeX
    2.7\miktex\bin;C:\Windows\system32;C:\Windows;C:\W indows\System32\Wbem;C:\Progra
    m Files\QuickTime\QTSystem\;C:\Windows\System32\Wind owsPowerShell\v1.0\;C:\Progr
    am Files\Common Files\Microsoft Shared\Windows Live
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WS F;.WSH;.MSC
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 6, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=1706
    ProgramData=C:\ProgramData
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    PSModulePath=C:\Windows\system32\WindowsPowerShell \v1.0\Modules\
    PUBLIC=C:\Users\Public
    QTJAVA=C:\Program Files\Java\jre6\lib\ext\QTJava.zip
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\Windows
    TEMP=C:\Users\NAME~1.NAME\AppData\Local\Temp
    TMP=C:\Users\NAME~1.NAME\AppData\Local\Temp
    TRACE_FORMAT_SEARCH_PATH=\\NTREL202.ntdev.corp.mic rosoft.com\4F18C3A5-CA09-4DBD-
    B6FC-219FDD4C6BE0\TraceFormat
    USERDOMAIN=PC
    USERNAME=NAME
    USERPROFILE=C:\Users\NAME
    windir=C:\Windows

    C:\Users\NAME>

    I replaced my name with NAME in the pasted stuff above.

    Thanks for the help!

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,609
    Rep Power
    23

    Default

    I don't see the path to your jdk bin folder in the PATH variable. The OS needs it to find the javac command.
    How did you add the path to the jdk?

  8. #8
    java1337 is offline Member
    Join Date
    Jun 2011
    Posts
    9
    Rep Power
    0

    Default

    I tried resaving the settings and repasting the addresses and now it seems to work. I put a semicolon and then the address with no spaces. "java -version" and "javac -version" in command prompt both yield results now. Thanks a lot for the help!

Similar Threads

  1. Replies: 5
    Last Post: 06-02-2011, 06:59 AM
  2. Replies: 2
    Last Post: 03-31-2010, 12:26 AM
  3. setting class-path & Library Path in ubantu
    By programmer_007 in forum Eclipse
    Replies: 18
    Last Post: 02-22-2010, 12:31 PM
  4. Replies: 3
    Last Post: 08-14-2009, 12:57 PM
  5. Replies: 2
    Last Post: 07-30-2007, 08:55 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
  •