Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Java, Windows 7 & Environment Variables

31 Dec 2010   #1

Windows 64 bit
 
 
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.

Quote:
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:

Quote:
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:

Quote:
'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 System SpecsSystem Spec
.

31 Dec 2010   #2

Windows 7 Ultimate x64 SP1, Windows 8.1 Pro x64
 
 

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 System SpecsSystem Spec
31 Dec 2010   #3

Windows 7 Home Premium
 
 

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 System SpecsSystem Spec
.


31 Dec 2010   #4

Vista Home Premium x86 SP2
 
 

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 System SpecsSystem Spec
31 Dec 2010   #5
Microsoft MVP

Windows 7 Ultimate 32bit SP1
 
 

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 System SpecsSystem Spec
31 Dec 2010   #6

Vista Home Premium x86 SP2
 
 

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 System SpecsSystem Spec
31 Dec 2010   #7

Windows 64 bit
 
 

Quote   Quote: Originally Posted by Jacee View Post
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.
Quote   Quote: Originally Posted by niemiro View Post
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:

Quote:
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 System SpecsSystem Spec
Reply

 Java, Windows 7 & Environment Variables




Thread Tools



Similar help and support threads for2: Java, Windows 7 & Environment Variables
Thread Forum
Windows 7 Environment Variables List Performance & Maintenance
Solved What are Environment Variables in Computer? General Discussion
SSD - Sys Prop, Environment Variables, or Reg Hack to move Defualt Dir Installation & Setup
Solved accidentally deleted path in environment variables System Security
Edit Environment Variables via command line Performance & Maintenance
Environment variables to point to the Java compiler General Discussion
Windows doesn't seem to keep my system environment variables Performance & Maintenance

Our Sites

Site Links

About Us

Find 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 09:08 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33