Ubuntu jdk 8 与 6 切换 (安装与配置)
Switch To Oracle JDK8
Switch To Oracle JDK8
1.1 Switch Oracle JDK in the Unbuntu 14.04 Step1 : Download a .tar.gz from Oracle(here i will be using jdk-8u91-linux-x64.tar.gz) http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Step2 : Extract it to directory /usr/lib/jvm
After extract it and set the permission
$sudo chmod -R /usr/lib/jvm/jdk1..0_91/ Step3 : Update the new JAVA environment , run below command one by one sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_91/bin/java" sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_91/bin/javac" sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0_91/bin/javaws" Step : Run below command to update the JAVA environment
sudo update-alternatives --config java root@icilubuntu-HP-Compaq--Pro-MT-PC:/usr/lib/jvm/oracle-jdk-6u35# sudo update-alternatives --config java
There are choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status
------------------------------------------------------------
* /usr/lib/jvm/java--openjdk-amd64/jre/bin/java auto mode
/usr/lib/jvm/java--openjdk-amd64/jre/bin/java manual mode
/usr/lib/jvm/jdk1..0_91/bin/java manual mode Press enter to keep the current choice[*], or type selection number: Select the number of new /usr/lib/jvm/jdk1..0_91/bin/java and press Enter . Now confirm that java command is the new installed one
Type: java -version
Should show:
java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) -Bit Server VM (build 25.91-b14, mixed mode) Step :sudo gedit /etc/profile 然后在其中加入如下的内容
. export JAVA_HOME=/usr/lib/jvm/jdk1..0_91
. export JRE_HOME=/usr/lib/jvm/jdk1..0_91/jre
. export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
. export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH 保存并退出,输入如下命令,使以上设置生效
. source /etc/profile Step : Set the Eclipse default JAVA environment Open Eclipse to menu Window-> Preferences-Installed JREs , set it to the new JDK path
Switch To Oracle JDK6
Switch To Oracle JDK6 . Install the oracle JDK as below
Step1 : Create “oracle-jdk-6u35” under “usr/lib/jvm/”
Step2 : Put the jdk-6u35-linux-x64.bin to “/usr/lib/jvm/oracle-jdk-6u35” and install the JDK
Type : $/usr/lib/jvm/oracle-jdk-6u35# ./jdk-6u35-linux-x64.bin
* jdk-6u35-linux-x64.bin http://192.168.18.224:8888/svn/Work_Space/Prototype/Integration_Workspace/software_env/jdk-6u35-linux-x64.bin
. Set /etc/alternatives which ensure all the java related programs are using the
same one, if not, will get the peer not authenticated error as below ::, WARN [PortalImpl:] com.liferay.portal.kernel.exception.SystemException: org.jets3t.service.S3ServiceException: Request Error: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated Step1: copy /usr/lib/jvm/.java--openjdk.jinfo to /usr/lib/jvm/.oracle-jdk-6u35.jinfo
Type: cp .java--openjdk.jinfo .oracle-jdk-6u35.jinfo Step : Register new alternatives in update-alternatives mechanism. Type:
cat .oracle-jdk-6u35.jinfo | grep -E '^(hl|jre|jdk)' | awk '{print "/usr/bin/" $2 " " $2 " " $3 " 30 \n"}' | xargs -t -n4 sudo update-alternatives --verbose --install Step3 : Check if successful registered, type:
update-java-alternatives -l
Then should show:
oracle-jdk-6u35 /usr/lib/jvm/oracle-jdk-6u35 Step4 : Set chosen option , type:
sudo update-java-alternatives -s oracle-jdk-6u35
update-alternatives: error: no alternatives for mozilla-javaplugin.so <<ignore it>>
Now confirm that java command is the new installed one
Type: java -version
Should show:
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
Java HotSpot(TM) -Bit Server VM (build 20.10-b01, mixed mode) Step5 : Copy the certificates from openjdk directory to oracle sun directory
Type: ls -l /etc/alternatives/keytool
Should show: /etc/alternatives/keytool -> /usr/lib/jvm/oracle-jdk-6u35/jdk1..0_35/jre/bin/keytool Type: sudo cp /usr/lib/jvm/java--openjdk/jre/lib/security/jssecacerts /usr/lib/jvm/oracle-jdk-6u35/jdk1..0_35/jre/lib/security
sudo cp /usr/lib/jvm/java--openjdk/jre/lib/security/cacerts /usr/lib/jvm/oracle-jdk-6u35/jdk1..0_35/jre/lib/security Step6 : set JAVA_HOME in tomcat's startup script /etc/init.d/tomcat6
export JAVA_HOME=/usr/lib/jvm/oracle-jdk-6u35/jdk1..0_35
Ubuntu jdk 8 与 6 切换 (安装与配置)的更多相关文章
- Ubuntu 14.04 下 android studio 安装 和 配置【转】
本文转载自:http://blog.csdn.net/xueshanfeihu0/article/details/52979717 Ubuntu 14.04 下 android studio 安装 和 ...
- Ubuntu 16.04下Java环境安装与配置
首先下载linux下的安装包 登陆网址https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.h ...
- Ubuntu 16.04服务器 软件的安装及配置
SSH的安装及配置 SSH分客户端openssh-client和openssh-server 如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则 ...
- (四)Ubuntu 14.04 文件服务器--samba的安装和配置
samba是Linux系统上的一种文件共享协议,可以实现Windows系统访问Linux系统上的共享资源,现在介绍一下如何在Ubuntu 14.04上安装和配置samba一. 一.更新源列表 打开&q ...
- Caffe + Ubuntu 15.04 + CUDA 7.0 安装以及配置
作为小码农的我,昨天就在装这个东东了,主要参考第一篇博文,但是过程发现很多问题,经过反反复复,千锤百炼,终于柳暗花明,我把这个caffe给搞定了,是故,我发布出来,后之来者,欲将有感于斯文~ 本分分为 ...
- Window下JDK、Tomcat、eclipse安装与配置
今天项目组开会,由于.Net平台的限制无法满足现有业务需求,项目计划从.Net平台转Java平台,采用Java+Spark+Hadoop,之前关于Java和Hadoop的书也买的有只是平时看的少,最近 ...
- ubuntu 14.04 (desktop amd 64) 安装和配置ROS Indigo
安装ROS 配置Ubuntu的软件源 配置Ubuntu要求允许接受restricted.universe和multiverse的软件源,可以根据下面的链接配置: https://help.ubuntu ...
- Ubuntu 12.04下mysql的安装与配置
转自:http://blog.csdn.net/ichsonx/article/details/9285935 准备 0. 获取 mysql-5.5.15-linux2.6-i686.tar.gz ...
- Tomcat与jdk在Linux上的安装与配置
本人qq群也有许多的技术文档,希望可以为你提供一些帮助(非技术的勿加). QQ群: 281442983 (点击链接加入群:http://jq.qq.com/?_wv=1027&k=29Lo ...
随机推荐
- hdu2067 小兔的棋盘 DP/数学/卡特兰数
棋盘的一角走到另一角并且不越过对角线,卡特兰数,数据量小,可以当做dp求路径数 #include<stdio.h> ][]; int main() { ; ) { int i,j; lon ...
- 常用css样式函数总结
1:按钮样式 /*按钮*/ @mixin btn-style($btnwidth, $color, $bgcolor, $bdcolor) { width: $btnwidth; height: 30 ...
- Django 数据库操作进阶F和Q操作
Model中的F F 的操作通常的应用场景在于:公司对于每个员工,都涨500的工资.这个时候F就可以作为查询条件 1 2 3 from django.db.models import F models ...
- leetcode:Pascal's Triangle II【Python版】
1.将tri初始化为[1],当rowIndex=0时,return的结果是:1,而题目要求应该是:[1],故将tri初始化为[[1]],返回结果设置为tri[0]即可满足要求: 2.最开始第二层循环是 ...
- binlog cache size设置是否合理判断
二进制日志是写操作是,首先写入二进制日志缓冲(binlog_cache)然后commit,再从binlog_cache写入到binlog文件,默认大小为32K,而binlog_cache是sessio ...
- [NN] 随机VS批训练
本文翻译节选自1998-Efficient BackProp, Yann LeCun et al.. 4.1 随机VS批训练 每一次迭代, 传统训练方式都需要遍历所有数据集来计算平均梯度. 批训练也同 ...
- 【转】每天一个linux命令(27):linux chmod命令
原文网址:http://www.cnblogs.com/peida/archive/2012/11/29/2794010.html chmod命令用于改变linux系统文件或目录的访问权限.用它控制文 ...
- 【Bitmap Index】B-Tree索引与Bitmap位图索引的锁代价比较研究
通过以下实验,来验证Bitmap位图索引较之普通的B-Tree索引锁的“高昂代价”.位图索引会带来“位图段级锁”,实际使用过程一定要充分了解不同索引带来的锁代价情况. 1.为比较区别,创建两种索引类型 ...
- Microsoft Dynamics CRM 4.0 JScript 通用公共方法
1.基本参数 var CRM_FORM_TYPE_CREATE = 1; var CRM_FORM_TYPE_UPDATE = 2; var CRM_FORM_TYPE_READ_ONLY = 3; ...
- VT-x is not available. (VERR_VMX_NO_VMX) on windows 8
've installed virtualbox on windows 8 x64, then when I open linux guest machine, I got this error me ...