java jdk8 ubuntu_ubuntu——How to Install Oracle Java JDK8

Check to see if your Ubuntu Linux operating system

architecture is 32-bit or 64-bit, open up a terminal and run the

following command below.

uname -a or file /sbin/init

Linux caochu-Inspiron-N5110 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/LinuxCheck if you have Java installed on your system. To do this, you will have to run the Java version command from terminal.Type/Copy/Paste:java -versio

If you have OpenJDK installed on your system, you have the wrong vendor version of Java installed for this exercise.

sudo apt-get purge openjdk-*Download the Oracle Java JDK for Linux.Unpack the compressed Java binaries, in the directory /usr/local/java8Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your./etc/profile file:export JAVA_HOME=/usr/local/java8/jdk1.8.0_73

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

export PATH=${JAVA_HOME}/bin:$PATH

source /etc/profile Configure default JDK version :sudo update-alternatives --install /usr/bin/java  java  /usr/local/java8/jdk1.8.0_73/bin/java      300

sudo update-alternatives --install /usr/bin/javac javac /usr/local/java8/jdk1.8.0_73/bin/javac    300

sudo update-alternatives --install /usr/bin/jar   jar   /usr/local/java8/jdk1.8.0_73/bin/jar 300

sudo update-alternatives --install /usr/bin/javah javah /usr/local/java8/jdk1.8.0_73/bin/javah  300

sudo update-alternatives --install /usr/bin/javap javap /usr/local/java8/jdk1.8.0_73/bin/javap 300

sudo update-alternatives --config javaTestjava -version

原文:http://caochun.blog.51cto.com/4497308/1759494

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值