Question:
I have the 64bit version of the JDK installed on Windows 7. I installed the version of the JRE as websites complained that I didn ' t has the Java plugin. I tried in vain-get Firefox to recognize, the 64bit JRE probably because Firefox is 32bit.
C:\Users\USER>java -versionjava version "1.6.0_31"Java(TM) SE Runtime Environment (build 1.6.0_31-b05)Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)C:\Users\USER>javac -versionjavac 1.7.0_02
Because of this, I can ' t run any of the programs that I compile. The entire thing is a real mess, here's my path. I have no idea why the Java and javac versions don ' t match.
C:\Users\USER>echo %path%C:\Program Files (x86)\PC Connectivity Solution\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\QuickTime\QTSystem\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Java\jdk1.7.0_02\bin;C:\Users\USER\gnu\msysgit\msysgit\bin;C:\Users\USER\gnu\bin;C:\Users\USER\gnu\ruby-1.9.3-p0-i386-mingw32\bin
If anybody have any pointers the to fix this sort of a thing in Windows, that ' d is most appreciated.
Answer
It seems.
- JDK 1.7.0_02-bit
- JRE 1.6.0_31
JRE also puts a java.exe
c:\Windows\System32
to, that's how first command is resolved. Second command is resolved by the C:\Program Files\Java\jdk1.7.0_02\bin
entry in your PATH variable.
If (and when) your is developing from the command prompt, you had to adjust the PATH variable so it is C:\Program Files\Java\jdk1.7.0_02\bin
before .
You can also persistently change the order, since Java browser extension does do depend on command line binaries and is I nstalled separately.
My usual schema in the Windows is installing JDK's and also installing nested public JRE ' s whenever necessary. It ' s very similar yo your schema. You just need to adjust PATH variable a bit if you'll be the working from command prompt.
Original address: Http://superuser.com/questions/391977/fix-java-version-mismatch-in-windows
Fix Java version mismatch in Windows---StackOverflow