Fix java version mismatch in windows---stackoverflow
Question:
I have the 64bit version of the jdk installed on windows 7. I installed the 32 bit version of the jre as websites complained that I didn't have the java plugin. I tried in vain to get firefox to recognize the 64bit jre probably because firefox is 32bit.
C:\Users\USER>java -version
java 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 -version
javac 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 has any pointers on how to fix this sort of a thing in windows, that'd be most appreciated.
Answer
It seems that you have
- JDK 1.7.0_02 64 bit
- JRE 1.6.0_31 32 bit
JRE also puts a java.exe to c:\Windows\System32, 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) you are developing from the command prompt, you have to adjust the PATH variable so that C:\Program Files\Java\jdk1.7.0_02\bin is before c:\Windows\System32.
You can also persistently change the order, since Java browser extension does not depend on command line binaries and is installed separately.
My usual schema in 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 will be working from command prompt.
原文地址:http://superuser.com/questions/391977/fix-java-version-mismatch-in-windows
Fix java version mismatch in windows---stackoverflow的更多相关文章
- [Android] "Failed to find Java version for 'C:\Windows\system32\java.exe"
Impossible to install SDK r17 on win 7 x64 "Failed to find Java version for 'C:\Windows\system3 ...
- 安装Android Studio报failed to find java version for 'C:\windows\system32\java.exe':[2] The system cannot find the specified file.错误的解决方案
方案很简单,找到SYSTEM32目录下的java.exe文件,重命名为java.exe.orj. 方案出处:http://stackoverflow.com/questions/10339679/an ...
- Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet Unknown Faceted Project Problem (Java Version Mismatch)
project 编译问题,需要三处的jdk版本要保持一致,才能编译通过. 1.在项目上右键properties->project Facets->修改右侧的version 保持一致 2. ...
- Windows Intellij环境下Gradle的 “Could not determine Java version from ‘9.0.1’”的解决方式
当我导入Gradle项目初试Java spring的时候,遇到下面报错: Gradle complete project refresh failed Error:Could not determin ...
- JDK1.6 1.7 1.8 多版本windows安装 执行命令java -version 版本不变的问题
现在Windows的java安装已经没有解压版本,Oracle官方也不会再提供了,只有安装程序 所以每当安装一次JDK,都会将 java.exe.javaw.exe.javaws.exe三个可执行文件 ...
- windows系统下,安装多个版本的jdk,java -version
问题描述: 开始安装了 jdk8 后来装了jdk9,可以为项目配置不同的jdk,相安无事: 今天发现软件需要jdk8的环境,结果我的java -version始终是jdk9.0.1: 解决办法:使ja ...
- java -version 问题 : C:\ProgramData\Oracle\Java\javapath;
我把 JAVA_HOME 从8改成了 7 , 为什么还是 显示的8啊 ! E:\sv0\jars>java -version java version "1.8.0_111" ...
- java -version 问题
我把 JAVA_HOME 从8改成了 7 , 为什么还是 显示的8啊 ! E:\sv0\jars>java -version java version "1.8.0_111" ...
- 【转】运行java -version命令时出现错误及解决
转载地址:http://blog.sina.com.cn/s/blog_50f21fed01012sf2.html 按照上一篇的步骤配置JAVA_HOME.CLASSPATH和Path三个变量 ...
随机推荐
- Ipv6_Only-b
网上好多关于ipv6的资料,说半天ipv6是什么,怎么建立测试环境,,,可是没有看到具体的操作和解决的方案,这里,为大家提供一种方案,希望给大家带来帮助吧. 总的来说有三个方面需要进行检查和修改: 1 ...
- 用三或四个个div标签实现工字效果
使用重构的方式制作出一个如下图的水平.垂直都居中,短边为50px,长边为150px的红色“工”字. a) 使用3个div完成 <!DOCTYPE html><html lang=&q ...
- nutch 1.7 导入 eclipse
开发环境建议:ubuntu+eclipse (windows + cygwin + eclipse不推荐) 第一步:下载http://archive.apache.org/dist/nutch/从上述 ...
- CAVLC
在H.264标准中,CAVLC(Context-based Adaptive Variable Length Coding)被用于亮度和色度残差数据编码.在标准的码流结构中,CAVLC编码方式描述为c ...
- Android开源项目发现--- 工具类快速开发篇(持续更新)
1. Guava Google的基于java1.6的类库集合的扩展项目 包括collections, caching, primitives support, concurrency librarie ...
- mysql grant 示例
' with grant option; FLUSH PRIVILEGES;
- 《Effective C++》条款26 防卫潜伏的ambiguity模棱两可的状态
每个人都有思想.有些人相信自由经济学,有些人相信来生.有些人甚至相信COBOL是一种真正的程序设计语言.C++也有一种思想:它认为潜在的二义性不是一种错误.ambiguity 这是潜在二义性的一个例子 ...
- HDU 4430 Yukari's Birthday (二分+枚举)
题意:给定一个n(18 ≤ n ≤ 10^12),一个等比数列k + k^2 + .......+ k^r = n 或者 = n-1,求出最小的k*r,如果最小的不唯一,则取r更小的 分析:两个未知数 ...
- wcf双工通讯遇到的问题
1.向ChannelFactory提供的InstanceContext包含未实现CallbackContractType的问题 通过添加服务引用生成的客户端代码, public class Callb ...
- WordPress Shareaholic 插件跨站请求伪造漏洞
漏洞名称: WordPress Shareaholic 插件跨站请求伪造漏洞 CNNVD编号: CNNVD-201308-250 发布时间: 2013-08-19 更新时间: 2013-08-19 危 ...