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三个变量 ...
随机推荐
- git 创建多个账户ssh
创建一个账户 创建ssh本地秘钥. $ ssh-keygen -t rsa -C "youremail@xxx.com" 一路回车,会在~/.ssh/目录下生成id_rsa和id_ ...
- ASP.NET MVC轻教程 Step By Step 11——数据注解
将验证规则写在Cotroller里不是一个好办法,这样会显得代码很啰嗦,更重要的是将业务逻辑写入Controller,使得Controller变得更“重”,不符合设计原则.更好的办法是使用验证注解属性 ...
- spring- properties 读取的五种方式
转至:http://www.cnblogs.com/hafiz/p/5876243.html 方式1.通过context:property-placeholder加载配置文件jdbc.properti ...
- PC硬件之我见——CPU篇
写在最前面: 最近身边很多朋友都购置电脑的想法,往往也会选择性价比较高的DIY攒机方式.不幸的是,并不是所有人都对电脑硬件有一定的了解的,何况在现在这种社会风气下,盲目的相信商家是不明智的.所 ...
- iOS MD5加密算法
考虑到用户账户安全,对用户的登录密码进行MD5加密 什么是MD5加密呢...懒了就不在这搬砖了,大家可以自己搜索查查,在此记录下代码,以供以后学习查询! 下面,直接上代码... // 需要倒入这个头文 ...
- Hbase Java API程序设计步骤
http://www.it165.net/admin/html/201407/3390.html 步骤1:创建一个Configuration对象 包含了客户端链接Hbase服务所需的全部信息: zoo ...
- BlockingQueue队列学习
今天看了下BlockingQueue的几种实现,记录下以便以后复习. 首先来看一下BlockingQueue的家族成员: BlockingQueue除了先进先出外,还有两个操作:在队列为空时,获取元素 ...
- 【HDOJ】1908 Double Queue
双端队列+二分. #include <cstdio> #define MAXN 1000005 typedef struct { int id; int p; } node_st; nod ...
- Ubuntu 桌面歌词
Ubuntu 有个用来显示歌词软件叫 osd-lyrics. 这个软件的强大之处在于他可以和各种播放器配合, 并且可以自动下载歌词. 自从升级到14.04后不能用了,便以为该软件被废弃了. 无意中发现 ...
- dpkg error
在ubuntu乱搞,突然出现错误 dpkg: error: cannot read info directory: No such file or directory E: Sub-process / ...