Java, Windows 7 & Environment Variables


  1. Posts : 2
    Windows 64 bit
       #1

    Java, Windows 7 & Environment Variables


    I have installed Java in Program Files (x86) > Java > jre > bin

    In Environment Variables, I accidentally deleted the default PATH variable.

    This is what I currently have in the PATH variable: Please can someone tell me what the default PATH was? I will add this in front of the Java path.

    C:\Program Files (x86)\Java\jre6\bin;
    Same question for CLASSPATH. What was the default variable for CLASSPATH?

    -----

    I open up CMD and type java -version and javac -version

    For java -version I get:

    java version "1.6.0_23"
    Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
    Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
    For javac -version I get:

    'javac' is not recognized as an internal or external command,
    operable program or batch file.
    What am I doing wrong? How do I make java work on windows 7 and what are the right paths to enter?

    Thank you!
      My Computer


  2. Posts : 1,872
    Windows 10 Pro x64, Windows 8.1 Pro x64, Windows 7 Ultimate x64 SP1,
       #2

    This is in Windows 7 x64 Ultimate

    CLASSPath
    .;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip

    QTJAVA
    C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
      My Computer


  3. Posts : 259
    Windows 10 Home
       #3

    This may not be the right way to do it, but if that happened to me I would uninstall and re-install Java rather than spending too much time trying to find the default paths.
      My Computer


  4. Posts : 908
    Vista Home Premium x86 SP2
       #4

    Hello!

    PATH:
    Code:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem;
    Example additionals:
    Code:
    C:\Program Files\ATI Stream\bin\x86;%CommonProgramFiles%\Microsoft Shared\Windows Live;c:\Program Files\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\DTS\Binn;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft Windows Performance Toolkit;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Program Files\QuickTime\QTSystem
    CLASS PATH:
    Code:
    .;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
    Good luck!

    Richard
      My Computer


  5. Posts : 8,608
    Windows 7 Ultimate 32bit SP1
       #5

    I would uninstall it and reinstall. Follow these instructions:

    • Download the latest version of Java Runtime Environment (JRE) 6.
    • Scroll down to where it says "Java Runtime Environment (JRE) 6u23 allows end-users to run Java applications".
    • Click the "Download" button to the right.
    • Check the box that says: "Accept License Agreement".
    • The page will refresh.
    • Click on the link to download Windows Offline Installation with or without Multi-language and save to your desktop.
    • Close any programs you may have running - especially your web browser.
    • Go to Start > Control Panel double-click on Add/Remove programs and remove all older versions of Java.
    • Check any item with Java Runtime Environment (JRE or J2SE) in the name.
    • Click the Remove or Change/Remove button.
    • Repeat as many times as necessary to remove each Java versions.
    • Reboot your computer once all Java components are removed.
    • Then from your desktop double-click on jre-6u23-windows-i586-p.exe to install the newest version.
      My Computer


  6. Posts : 908
    Vista Home Premium x86 SP2
       #6

    Hello!

    Just to confirm we are on the right lines, you have completely deleted your path variable, including the normal Windows ones, installed Java, which added itself back in, but you want the other ones to avoid a reinstall?

    Thanks!

    Richard
      My Computer


  7. Posts : 2
    Windows 64 bit
    Thread Starter
       #7

    Jacee said:
    I would uninstall it and reinstall. Follow these instructions:

    • Download the latest version of Java Runtime Environment (JRE) 6.
    • Scroll down to where it says "Java Runtime Environment (JRE) 6u23 allows end-users to run Java applications".
    • Click the "Download" button to the right.
    • Check the box that says: "Accept License Agreement".
    • The page will refresh.
    • Click on the link to download Windows Offline Installation with or without Multi-language and save to your desktop.
    • Close any programs you may have running - especially your web browser.
    • Go to Start > Control Panel double-click on Add/Remove programs and remove all older versions of Java.
    • Check any item with Java Runtime Environment (JRE or J2SE) in the name.
    • Click the Remove or Change/Remove button.
    • Repeat as many times as necessary to remove each Java versions.
    • Reboot your computer once all Java components are removed.
    • Then from your desktop double-click on jre-6u23-windows-i586-p.exe to install the newest version.
    niemiro said:
    Hello!

    Just to confirm we are on the right lines, you have completely deleted your path variable, including the normal Windows ones, installed Java, which added itself back in, but you want the other ones to avoid a reinstall?

    Thanks!

    Richard
    Thank you for the replies.

    Richard, I have copied and pasted the default paths back in the right places! Thank you!

    Jacee, thanks for your instructions. I have followed them and now my java pack is installed in this location:

    C:\Program Files\Java\jre6\bin
    I have added it to the end of the PATH environment variable.

    However, when I opened up cmd and entered java -version and javac -version, I am still getting the same error for javac -version.

    I don't know what I am doing wrong!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:41.
Find Us