• 欢迎访问金笔头博客,这是一个菜鸟(伪)程序员的自留地,欢迎访问我的github:点击进入

ubuntu kylin 15.04安装JDK

java eason 2748次浏览 4个评论 扫描二维码

昨天晚上下载安装了ubuntu最新版的麒麟系统,听说对中文的支持很好,计划用来跑hadoop,所以先把JDK配置起来

第一步:到oracle官网下载JDK

我下载的JDK 8 linux x64位系统

甲骨文官网链接:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

也可以使用linux命令下载:

wget –c  http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

第二步:解压安装

新建一个文件夹作为jdk解压安装后的地址

sudo mkdir  /usr/lib/jvm

sudo tar zxvf jdk-8u60-linux.tar.gz –c /usr/lib/jvm

第三步:修改环境变量

sudo gedit /etc/profile

添加java环境:

#set java environment

#set java environment
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_60
export JRE_HOME=${JAVA_HOME}/jdk1.8.0_60/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

image

第四步:配置默认JDK版本

(如果之前安装过其他版本的JDK,使用这步可以选择链接此次安装的JDK为默认版本)

sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk 1.8.0_60/bin/java 300 


sudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/jdk 1.8.0_60/bin/javac 300
 

如果需要更换jdk版本的话

使用sudo update-alternatives –config java 

可以看到所有JDK的配置信息

第一次安装可以跳过此步

第五步:测试

在控制台console中输入

java –version

如果出现以下信息

java version “1.8.0_60”
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

就说明jdk安装成功

其他版本也可效法上述过程


金笔头博客, 版权所有丨如未注明 , 均为原创, 转载请注明ubuntu kylin 15.04安装JDK
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(4)个小伙伴在吐槽
  1. o1aNyh Usually I don at read article on blogs, however I would like to say that this write-up very compelled me to check out and do so! Your writing taste has been amazed me. Thanks, quite nice article.
    crorkservice2016-02-04 07:55 Reply Windows XP | Internet Explorer 6.0
  2. Really appreciate you sharing this article post. Fantastic.
    paris hilton2016-02-03 02:37 Reply Windows 7 | Firefox 3.5.3
  3. I simply want to mention I am just beginner to blogging and really loved this web-site. Likely I’m planning to bookmark your website . You really have outstanding articles. Many thanks for sharing with us your website page.
    important source2016-01-28 08:40 Reply Windows XP | Opera 9.64
  4. Thanks-a-mundo for the article.Thanks Again. Will read on...
    fiverr seo2016-01-02 06:46 Reply Windows 7 | Firefox 3.5.3