注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

艾伯特的鸟屋

 
 
 

日志

 
 

Install jdk 8 on Ubuntu (转载)  

2014-10-15 21:33:14|  分类: linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
http://www.tuicool.com/articles/zmEfMn
原文  http://www.devsniper.com/install-jdk-8-on-ubuntu/

Installing Oracle JDK 8 on Ubuntu:

  • Download the Oracle JDK 8 tar file from here
  • Extract the tar file: 
tar -xvzf jdk-8-linux-x64.tar.gz
  • Create jvm folder in /usr/lib, if jvm folder not exist
sudo mkdir /usr/lib/jvm
  • Move extracted jdk 8 folder to this location:
sudo mv jdk1.8.0 /usr/lib/jvm/jdk1.8.0
  • Install new java source in system:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws 1
  • Choose default java:
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
  • Java version test:
java -version

# java version "1.8.0"
# Java(TM) SE Runtime Environment (build 1.8.0-b132)
# Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
  • Verify the symlinks all point to the new java location:
ls -la /etc/alternatives/java*
 
  • Enable Java plugin for Mozilla Firefox (even for Chrome)
# for 64-Bit jdk
sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins
# for 32-Bit jdk
sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins
JAVA_HOME configuration: Some tools require JAVA_HOME variable. You can set JAVA_HOME on Ubuntu either:
  1. With /etc/environment:
  2. sudo gedit /etc/environment
    # add the following line, save and exit
    JAVA_HOME=/usr/lib/jvm/jdk1.8.0
  3. Or in your home directory with .bashrc:
sudo gedit .bashrc
# add the following lines, save and exit
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0
export PATH=$JAVA_HOME/bin:$PATH



  评论这张
 
阅读(501)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017