娇滴滴的Mac,一次升级jdk导致的“事故”
2016-03-29 22:25
711 查看
起因
以前在windows上升级jdk1.7的时候,可以直接把原来的jdk卸载了,在安装jdk1.8,不知道能不能直接从1.7升级到1.8而不用卸载。现在在Mac上如初一辙,也这样干了,在网上搜了一堆乱七八糟的文章就开干了,然后就悲剧了。命令如下:
如果要卸载已经安装的jdk,请参考oracle官网上的reference,不要随便在网上找个教程就弄上了,因为rm -f是不能恢复的
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.For example, to uninstall 8u6:
% rm -rf jdk1.8.0_06.jdk
Do not attempt to uninstall Java by removing the Java tools from/usr/bin
. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
千万不要尝试着去删除/usr/bin/中的java*什么的
好吧,我已经做了!
会出现什么现象呢?你会发现很多变化,比如说开机界面上变成了英文什么的,关机弹窗变成了英文什么的,除此之外还有一些其他变化,如果你有幸误操作删除了系统自带的jdk1.6,你就会看到了。
那么如何恢复呢?
你可以和Apple客服掐架,当然一般是个女客服,也不会什么技术,你会发现掐了半个小时也没啥用,别问我为啥,因为我试过。浪费时间和电话费,那就去apple官网去看看Apple support什么的,也许有帮助。
进入 Apple官网,然后搜索,
进入如下页面
然后:
https://support.apple.com/kb/DL1572?viewlocale=zh_CN&locale=zh_CN
下载jdk,自行安装即可。
补充一句,开发用的jdk其实和Apple自己的jdk没啥关系,可以共存的,当然oracle的1.7和1.8也可以共存的,试着搜一下jEnv就知道了。
以前在windows上升级jdk1.7的时候,可以直接把原来的jdk卸载了,在安装jdk1.8,不知道能不能直接从1.7升级到1.8而不用卸载。现在在Mac上如初一辙,也这样干了,在网上搜了一堆乱七八糟的文章就开干了,然后就悲剧了。命令如下:
432 sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 433 sudo rm -fr /Library/PreferencesPanes/JavaControlPanel.prefpane 434 cd /usr/bin/ 435 ll 436 rm -f wsimport 437 sudo rm -f wsimport 438 jmc 439 find / -name JavaAppletPlugin.plugin 440 rm -rf /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin 441 sudo find / -name JavaAppletPlugin.plugin 442 sudo rm -rf /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin 443 /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin 444 cd /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin 445 ll 446 cd .. 447 ll 448 rm -rf JavaAppletPlugin.plugin/ 449 sudo 450 sudo root 451 sudo -i 452 jmc 453 javac 454 java -version 455 java -version 456 javac 457 ll 458 java 459 sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin 460 sudo rm -rf /Library/Preferences/ 461 sudo -i
如果要卸载已经安装的jdk,请参考oracle官网上的reference,不要随便在网上找个教程就弄上了,因为rm -f是不能恢复的
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.For example, to uninstall 8u6:
% rm -rf jdk1.8.0_06.jdk
Do not attempt to uninstall Java by removing the Java tools from/usr/bin
. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
千万不要尝试着去删除/usr/bin/中的java*什么的
好吧,我已经做了!
会出现什么现象呢?你会发现很多变化,比如说开机界面上变成了英文什么的,关机弹窗变成了英文什么的,除此之外还有一些其他变化,如果你有幸误操作删除了系统自带的jdk1.6,你就会看到了。
那么如何恢复呢?
你可以和Apple客服掐架,当然一般是个女客服,也不会什么技术,你会发现掐了半个小时也没啥用,别问我为啥,因为我试过。浪费时间和电话费,那就去apple官网去看看Apple support什么的,也许有帮助。
进入 Apple官网,然后搜索,
进入如下页面
然后:
https://support.apple.com/kb/DL1572?viewlocale=zh_CN&locale=zh_CN
下载jdk,自行安装即可。
补充一句,开发用的jdk其实和Apple自己的jdk没啥关系,可以共存的,当然oracle的1.7和1.8也可以共存的,试着搜一下jEnv就知道了。
相关文章推荐
- 什么是Mac OS X?跟Linux有什么区别
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- Ubuntu 安装 JDK 问题
- Linux vs Mac:Linux 比 Mac 好的 7 个原因
- 苹果mac OS X上安装metasploit
- Validation of viewstate MAC failed.的解决方法
- Mac平台中编译安装Lua运行环境及Hello Lua实例
- 在Mac OS中安装Lua的教程
- vbs Windows系统改变或修改网卡的MAC地址的脚本与软件第1/2页
- MAC官方菜单纯CSS实现灰色会换色
- mac系统OS X10.10版本安装最新5.7.9mysql的方法
- 在Mac OS下使用Node.js的简单教程
- Mac环境下php操作mysql数据库的方法分享
- PHP中获取内网用户MAC地址(WINDOWS/linux)的实现代码
- jQuery根据用户电脑是mac还是pc加载对应样式的方法
- 在MAC OS X上安装MYSQL
- Shell脚本获取本地网卡IP、mac地址、子网掩码、dns IP、外网IP
- MAC系统中添加MYSQL开机启动的方法
- jdk与jre的区别 很形象,很清晰,通俗易懂