简体   繁体   English

删除默认的jdk 1.7版本并在Windows上设置1.6

[英]Remove default jdk 1.7 version and set 1.6 on windows

I had installed both version of jdk 1.6 and 1.7 and have projects which are developed on version 1.6 . 我已经安装了jdk 1.61.7两个版本,并且拥有在1.6版本上开发的项目。 So I need 1.6 . 所以我需要1.6 I set path in environmental variable for version 1.6 . 我在版本1.6环境变量中设置路径。 But still showing version 1.7 when I used java -version from cmd . 但是当我从cmd使用java -version时仍然显示1.7版本。

I want to make default version of jdk 1.6 on my computer. 我想在我的电脑上制作jdk 1.6默认版本。 I am using windows 7 . 我正在使用windows 7

NOTE: I do not want to uninstall 1.7 and I do not have administrative privileges. 注意:我不想卸载1.7并且我没有管理权限。

Please Help. 请帮忙。

While instalation Java exe files are copied to windows System32 folder, Check this location( C:\\Windows\\System32 ) java.exe, javaw.exe and javaws.exe are available there. 当instalation Java exe文件被复制到Windows System32文件夹时,检查此位置( C:\\Windows\\System32java.exe,javaw.exe和javaws.exe是否可用。

What you need to do now is, replace this exe's with jdk 1.6 exe's and open a new command prompt and check the version. 你现在需要做的是,用jdk 1.6 exe替换这个exe并打开一个新的命令提示符并检查版本。

First of all be sure that the java 1.6 home path is put in the beginning of Windows path, because the first met path is used. 首先要确保将java 1.6主路径放在Windows路径的开头,因为使用了第一个满足路径。 If you have done that try to start the command prompt NOT as an administrator and check the java version. 如果您已经这样做,请尝试以管理员身份启动命令提示符并检查java版本。 Strangely I had the same issue and I succeeded to start the java 1.6 version only in a command prompt without administrative privileges. 奇怪的是我有同样的问题,我成功只在没有管理权限的命令提示符下启动java 1.6版本。

在PATH开头的PATH变量中添加JavaPath \\ bin。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM