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三个变量 ...
随机推荐
- linux下date命令实现时间戳与日期的转换
1.查看指定时间的时间戳 查看当前时间 #date +%s 查看指定时间 #date -d 2008-01-01 +%s 1199116800 #date -d 20080101 ...
- linux平台上面python调用c
不能免俗,先打印个helloworld出来,c代码的函数 hello.c #include <stdio.h> int helloworld() { printf("hello ...
- code jam训练
https://code.google.com/codejam/contests.html http://student.csdn.net/mcs/programming_challenges
- initWithCoder: 与initWithFrame:
之前一直用代码来编写画面,现在着手使用storyboard和xib来构筑画面,遇到initWithCoder方法, 故查了下,initWithCoder方法的调用,看了篇博客,链接如下: http:/ ...
- indexedDB article
http://www.html5china.com/HTML5features/LocalStorage/20110926_2022.html http://www.cnblogs.com/haner ...
- mysql视图的作用(详细)
测试表:user有id,name,age,sex字段 测试表:goods有id,name,price字段 测试表:ug有id,userid,goodsid字段 视图的作用实在是太强大了,以下是我体验过 ...
- 【HDOJ】1455 Sticks
DFS.搜索以棍数为条件循环搜索较好,这样不会超时. #include <stdio.h> #include <string.h> #include <stdlib.h& ...
- java学习面向对象之接口
上一节当中我们说道抽象类,抽象类当中的方法可以是抽象的也可以是非抽象的,那么当抽象类中所有方法都是抽象的时候,我们就可以把它重新定义为接口.代码示例: abstract class Animal { ...
- poj3167
这道题是一道kmp的扩展版的好题一串匹配一串很容易想到kmp,但是这里的匹配要求的是两个串的名次相同显然名次是会变的,为了方便,我们可以换一种表达对于两个等长的串的相同位置,名次相等就是在它之前比它小 ...
- nginx -- 安装配置Nginx
安装说明 系统环境:CentOS-6.3 软件:nginx-1.2.6.tar.gz 安装方式:源码编译安装 安装位置:/usr/local/nginx 下载地址:http://nginx.org ...