博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Fix java version mismatch in windows---stackoverflow
阅读量:6233 次
发布时间:2019-06-22

本文共 2314 字,大约阅读时间需要 7 分钟。

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

转载地址:http://irqna.baihongyu.com/

你可能感兴趣的文章
将语法从词法解析器中分离出来
查看>>
SpringBoot基础篇AOP之基本使用姿势小结
查看>>
Android中AsyncTask的简单用法
查看>>
Android 获取dimen值
查看>>
Camel In Action 读书笔记 (9)
查看>>
Gallery实现首页图片滑动源码
查看>>
ehlib 修改 使指示区背景色 和 数据区 背景色一致
查看>>
关于MySQL的init-file选项的用法实例
查看>>
对memcached使用的总结和使用场景
查看>>
Python 当前时间增加或减少一个月
查看>>
CollectionUtil
查看>>
平衡二叉树
查看>>
Android应用开发新路线
查看>>
smartHost 北京服务器
查看>>
制作自己的网络字体
查看>>
Xcode的包管理器:Alcatraz
查看>>
WinForms Adorner UI Manager v16.1支持高亮特定控件
查看>>
开源 免费 java CMS - FreeCMS1.2-功能说明-会员管理
查看>>
apache的mime.types作用
查看>>
语言的对于处理器的字长问题
查看>>