首页 > 代码库 > 升级Yosemite后java7不能使用

升级Yosemite后java7不能使用

环境说明: 升级之前mac系统安装的是java 7 在eclipse能够正常使用,升级以后无法使用
目的: 删除java 7 回到java6环境 重新配置 eclipse  installJre路径的java包 

操作如下:

mac下切换到root权限:
topwqp:~ wangqiupeng$ sudo -i
Password:
topwqp:~ root# whoami
root
topwqp:~ root#

mac下删除java 7 环境:
refer:  http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html

Uninstalling the JDK

To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.

Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:*

    /Library/Java/JavaVirtualMachines/jdk<major>.<minor>.<macro[_update]>.jdk

For example, to uninstall 7u6:

    % rm -rf jdk1.7.0_06.jdk
执行操作为:
topwqp:~ root# cd /Library/Java/JavaVirtualMachines/
topwqp:JavaVirtualMachines root# rm -rf jdk1.7.0_55.jdk
topwqp:JavaVirtualMachines root# ls
topwqp:JavaVirtualMachines root# java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode

以上操作完成以后 java 7就删除了,现在环境编程 jdk6了

本机寻找JDK安装路径:
opwqp:Home wangqiupeng$ pwd
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

升级Yosemite后java7不能使用