首页 > 编程语言 > 详细

install sun java in ubuntu

时间:2014-04-19 18:02:18      阅读:567      评论:0      收藏:0      [点我收藏+]

1. 下载:

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

2. 解压安装:

sudo tar zxvf ./jdk-7u45-linux-x64.tar.gz  -C /usr/lib/jvm  
cd /usr/lib/jvm  
sudo mv jdk1.7.0_45/ java-7-sun  

3. 环境变量:

export JAVA_HOME=/usr/lib/jvm/java-7-sun  
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH

4. 配置默认:

bubuko.com,布布扣
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300  
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300  
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-sun/bin/jar 300   
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/java-7-sun/bin/javah 300   
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/java-7-sun/bin/javap 300   
bubuko.com,布布扣
sudo update-alternatives --config java  

参考:http://blog.csdn.net/snowdream86/article/details/6677450

install sun java in ubuntu,布布扣,bubuko.com

install sun java in ubuntu

原文:http://www.cnblogs.com/sunshy/p/3675240.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!