Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 13 of 13

Thread: Issue with PATH system variable

  1. #1
    Member
    Join Date
    Mar 2010
    Posts
    271
    Thanks
    21
    Thanked 7 Times in 7 Posts

    Question Issue with PATH system variable

    Hello all,

    Some installations have changed the value of the PATH variable. I know how to change it back but I'm not sure if it can cause my pc any harm. its current value is: C:\Program Files\AMD APP\bin\x86;%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\orant\bin;%SystemRoot%\system32;%SystemRoo t%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\HP\Digital Imaging\bin;C:\Program Files\HP\Digital Imaging\bin\;C:\Program Files\HP\Digital Imaging\bin\Qt\Qt 4.3.3;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

    Is there any harm in changing it?

    Thank you.
    -Mel


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Issue with PATH system variable

    The OS uses its value to find files. If you mess it up, the OS may not be able to find some files.

    Copy and contents and save it in a file just in case something stops working you can paste it back the way it was.

    Another idea(I've never tried this) would be to create another Environment variable: PATH_SAVED and copy the current Path's value into the new one. Then change the current one. If there is a problem you could rename PATH to PATH_OLD and rename PATH_SAVED to PATH to restore the original.

  3. #3
    Member
    Join Date
    Mar 2010
    Posts
    271
    Thanks
    21
    Thanked 7 Times in 7 Posts

    Default Re: Issue with PATH system variable

    Quote Originally Posted by Norm View Post
    The OS uses its value to find files. If you mess it up, the OS may not be able to find some files.

    Copy and contents and save it in a file just in case something stops working you can paste it back the way it was.

    Another idea(I've never tried this) would be to create another Environment variable: PATH_SAVED and copy the current Path's value into the new one. Then change the current one. If there is a problem you could rename PATH to PATH_OLD and rename PATH_SAVED to PATH to restore the original.
    Thanks I will try that. But what will I do if I have to revert it back, no more cmd compiling? :/

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Issue with PATH system variable

    If you are careful you should not have to revert back.

  5. #5
    Member
    Join Date
    Mar 2010
    Posts
    271
    Thanks
    21
    Thanked 7 Times in 7 Posts

    Default Re: Issue with PATH system variable

    Hmm, Windows wont recognize javac even though I set the path variable to the right directory.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Issue with PATH system variable

    Are you sure?
    Can you open a command prompt window and enter: PATH
    and copy the window's contents and post it here.
    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.

    Here is what I see:
    Microsoft Windows XP [Version 5.1.2600]

    D:\JavaDevelopment\Misc_Projects>path
    PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sys tem32\Wbem;C:\Perl\bin;C:\Prog
    ram Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft
    Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common
    \Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;D:\Java\jdk1.6.0_02\bin
    \;C:\BatchFiles\;C:\Program Files\Common Files\Nero\Lib\

    D:\JavaDevelopment\Misc_Projects>

  7. #7
    Member
    Join Date
    Mar 2010
    Posts
    271
    Thanks
    21
    Thanked 7 Times in 7 Posts

    Default Re: Issue with PATH system variable

    Here is what I got,
    HTML Code:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    
    C:\Documents and Settings\Leopard\Desktop>PATH
    PATH=C:\WINDOWS\System32;C:\Program Files\Java\jre6\bin
    
    C:\Documents and Settings\Leopard\Desktop>

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Issue with PATH system variable

    The javac.exe file is part of the JDK.
    Your PATH has a path to the jre6\bin folder. Look in that folder and see if there is a javac.exe file there.

  9. The Following User Says Thank You to Norm For This Useful Post:

    Melawe (December 27th, 2011)

  10. #9
    Member
    Join Date
    Mar 2010
    Posts
    271
    Thanks
    21
    Thanked 7 Times in 7 Posts

    Default Re: Issue with PATH system variable

    Quote Originally Posted by Norm View Post
    The javac.exe file is part of the JDK.
    Your PATH has a path to the jre6\bin folder. Look in that folder and see if there is a javac.exe file there.
    Strangely it is missing; although I'm sure it was there yesterday. I will try with the previous version(6 update 29).

  11. #10
    Member
    Join Date
    Mar 2010
    Posts
    271
    Thanks
    21
    Thanked 7 Times in 7 Posts

    Smile Re: Issue with PATH system variable

    It worked! Path value:
    HTML Code:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    
    C:\Documents and Settings\Leopard\Desktop>PATH
    PATH=C:\Program Files\Java\jdk1.6.0_25\bin
    
    C:\Documents and Settings\Leopard\Desktop>
    Test run:
    HTML Code:
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    
    C:\Documents and Settings\Leopard\Desktop>javac Args.java
    
    C:\Documents and Settings\Leopard\Desktop>java Args 3 3
    3 plus 3 equals 6
    
    C:\Documents and Settings\Leopard\Desktop>
    Thanks for helping Norm!

    -Mel

  12. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Issue with PATH system variable

    Your welcome.

  13. #12
    Junior Member
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Issue with PATH system variable

    glad to see you got help and got your problem resolved, i am having a similar problem may be you could help me . this is my dos path

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

    C:\Users\my>javac
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are u
    sed
    -classpath <path> Specify where to find user class files and annotati
    on processors
    -cp <path> Specify where to find user class files and annotati
    on processors
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -proc:{none,only} Control whether annotation processing and/or compil
    ation is done.
    -processor <class1>[,<class2>,<class3>...] Names of the annotation processors
    to run; bypasses default discovery process
    -processorpath <path> Specify where to find annotation processors
    -d <directory> Specify where to place generated class files
    -s <directory> Specify where to place generated source files
    -implicit:{none,class} Specify whether or not to generate class files for
    implicitly referenced files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release

    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -Akey[=value] Options to pass to annotation processors
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    -Werror Terminate compilation if warnings occur
    @<filename> Read options and filenames from file


    C:\Users\my>java -version
    Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg'

    C:\Users\my>path
    PATH=C:\Program Files\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Sh
    ared\Windows Live;C:\windows\system32;C:\windows;C:\windows\Sys tem32\Wbem;C:\win
    dows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared;C:\Pr
    ogram Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\WIDCOMM\Blueto
    oth Software\;C:\Program Files\Broadcom\Broadcom 802.11;C:\Program Files\QuickTi
    me\QTSystem\;C:\WINDOWS\system32;C:\WINDOWS;C:\Pro gram Files\Java\jdk1.7.0_02\bi
    n
    C:\Users\my> -version
    '-version' is not recognized as an internal or external command,
    operable program or batch file.

    C:\>cd \java -version
    The system cannot find the path specified.

    c:\Program Files>cd\ java
    The system cannot find the path specified.

    C:\Program Files>cd \Java
    The system cannot find the path specified.

    C:\Program Files>dir
    Volume in drive C has no label.
    Volume Serial Number is BC58-5CEE

    Directory of C:\Program Files

    12/28/2011 03:04 PM <DIR> .
    12/28/2011 03:04 PM <DIR> ..
    12/13/2011 07:04 PM <DIR> Adobe
    12/24/2011 11:12 AM <DIR> AMD APP
    12/13/2011 05:43 PM <DIR> Apple Software Update
    12/20/2011 06:18 PM <DIR> ArcSoft
    12/13/2011 12:38 PM <DIR> ATI
    12/24/2011 11:11 AM <DIR> ATI Technologies
    04/02/2011 12:36 PM <DIR> Bing Bar Installer
    12/13/2011 05:42 PM <DIR> Bonjour
    12/21/2011 01:20 PM <DIR> Brand Affinity Technologies
    12/13/2011 12:49 PM <DIR> Broadcom
    12/13/2011 12:51 PM <DIR> Cisco
    12/22/2011 10:08 PM <DIR> Common Files
    12/20/2011 06:03 PM <DIR> Conduit
    12/16/2011 08:40 AM <DIR> ConvertHelper
    12/13/2011 12:57 PM <DIR> Downloaded Installations
    12/17/2011 11:30 AM <DIR> Driver Manager
    12/15/2011 04:48 PM <DIR> DVD Maker
    12/21/2011 01:24 PM <DIR> Hewlett-Packard
    04/02/2011 12:45 PM <DIR> HP Games
    12/21/2011 01:21 PM <DIR> HyperCam 2
    12/21/2011 01:21 PM <DIR> Hyperionics DB Toolbar
    12/13/2011 01:00 PM <DIR> IDT
    12/28/2011 06:54 PM <DIR> Internet Download Manager
    12/19/2011 08:57 PM <DIR> Internet Explorer
    12/13/2011 05:46 PM <DIR> iPod
    12/13/2011 05:47 PM <DIR> iTunes
    12/28/2011 03:04 PM <DIR> Java
    12/26/2011 07:43 PM <DIR> jdk1.7.0_02_combo
    12/17/2011 12:50 PM <DIR> JetBrains
    12/26/2011 01:49 PM <DIR> JPSoft
    04/02/2011 12:36 PM <DIR> Microsoft
    12/17/2011 09:39 AM <DIR> Microsoft Application Virtualization Clie
    nt
    12/15/2011 07:25 PM <DIR> Microsoft Office
    12/22/2011 04:04 PM <DIR> Microsoft Security Client
    12/19/2011 02:45 PM <DIR> Microsoft Silverlight
    04/02/2011 12:33 PM <DIR> Microsoft SQL Server Compact Edition
    04/02/2011 11:42 AM <DIR> Microsoft.NET
    12/17/2011 11:24 AM <DIR> Mozilla Firefox
    07/13/2009 09:52 PM <DIR> MSBuild
    04/02/2011 12:36 PM <DIR> MSN Toolbar
    12/26/2011 09:53 PM <DIR> Notepad++
    12/13/2011 01:06 PM <DIR> Online Services
    12/15/2011 11:28 AM <DIR> Oracle
    12/15/2011 04:03 PM <DIR> QuickTime
    04/02/2011 01:02 PM <DIR> Realtek
    07/13/2009 09:52 PM <DIR> Reference Assemblies
    12/15/2011 04:04 PM <DIR> Safari
    12/22/2011 11:04 PM <DIR> SeaMonkey
    04/02/2011 12:30 PM <DIR> Synaptics
    12/20/2011 06:12 PM <DIR> TextAloud
    12/21/2011 02:07 PM <DIR> uTorrent
    12/21/2011 02:08 PM <DIR> uTorrentBar
    12/13/2011 12:45 PM <DIR> WIDCOMM
    12/17/2011 11:25 AM <DIR> Winamp
    12/17/2011 11:24 AM <DIR> Winamp Detect
    12/19/2011 08:57 PM <DIR> Windows Defender
    12/19/2011 08:57 PM <DIR> Windows Journal
    04/02/2011 12:33 PM <DIR> Windows Live
    12/19/2011 08:57 PM <DIR> Windows Mail
    12/19/2011 08:57 PM <DIR> Windows Media Player
    07/13/2009 09:52 PM <DIR> Windows NT
    12/19/2011 08:57 PM <DIR> Windows Photo Viewer
    12/15/2011 04:48 PM <DIR> Windows Portable Devices
    12/19/2011 08:57 PM <DIR> Windows Sidebar
    04/02/2011 12:08 PM <DIR> Windows Virtual PC
    12/13/2011 01:03 PM <DIR> Windows XP Mode
    12/20/2011 05:38 PM <DIR> WinZip
    12/17/2011 12:33 PM <DIR> Xinox Software
    0 File(s) 0 bytes
    70 Dir(s) 233,061,163,008 bytes free

    C:\Program Files>cd \Java
    The system cannot find the path specified.

    \Program Files>path
    PATH=C:\Program Files\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Sh
    ared\Windows Live;C:\windows\system32;C:\windows;C:\windows\Sys tem32\Wbem;C:\win
    dows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared;C:\Pr
    ogram Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\WIDCOMM\Blueto
    oth Software\;C:\Program Files\Broadcom\Broadcom 802.11;C:\Program Files\QuickTi
    me\QTSystem\;C:\WINDOWS\system32;C:\WINDOWS;C:\Pro gram Files\Java\jdk1.7.0_02\bi
    n;.

    C:\Program Files> Java
    Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg'


    C:\>java -version
    Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg'

    also cannot open java icon from control panel

    hope you have time to look at this but i understand if you dont...

  14. #13
    Member
    Join Date
    Mar 2010
    Posts
    271
    Thanks
    21
    Thanked 7 Times in 7 Posts

    Default Re: Issue with PATH system variable

    Try going to C:\Program Files\Java using the windows explorer. Then click search and type javac, hit enter. If you don't find it let us know.

Similar Threads

  1. Replies: 1
    Last Post: November 21st, 2011, 01:11 AM
  2. How to convert local path drive to UNC path
    By krisswift in forum Object Oriented Programming
    Replies: 2
    Last Post: November 17th, 2011, 08:40 AM
  3. Relative path issue with Context path struts
    By chinnu in forum Web Frameworks
    Replies: 1
    Last Post: March 31st, 2011, 10:17 AM
  4. issue with reading a clob variable from oracle
    By computerbum in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 28th, 2010, 06:08 PM
  5. how to get full path name from realtive path
    By priyanka3006 in forum File I/O & Other I/O Streams
    Replies: 8
    Last Post: August 10th, 2009, 04:28 AM