运维调试记录:Ubuntu下通过PPA方式安装Java 8并自动配置环境变量

  1. 云栖社区>
  2. 博客>
  3. 正文

运维调试记录:Ubuntu下通过PPA方式安装Java 8并自动配置环境变量

adoryn 2016-04-11 20:32:59 浏览514
展开阅读全文
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhaobryant/article/details/51125246

Install OpenJDK 8 in Ubuntu:
For 14.10 and later just run apt-get install openjdk-8-jdk

Oracle JAVA 8 Stable release has been released on Mar,18 2014 and available to download and install on official download page. Oracle Java PPA for Ubuntu and LinuxMint is being maintained by Webupd8 Team. JAVA 8 is released with many of new features and security updates, read more about whats new in Oracle Java 8.

Installing Java 8 on Ubuntu

First you need to add webupd8team Java PPA repository in your system and install Oracle Java 8 using following set of commands.

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Verify Installed Java Version

After successfully installing oracle Java using above step verify installed version using following command.

zjl@zjl-uestc:~$ java -version

java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Configuring Java Environment

In Webupd8 ppa repository also providing a package to set environment variables, Install this package using following command.

$ sudo apt-get install oracle-java8-set-default

System Java version switch

$ sudo update-java-alternatives -s java-8-oracle

References:

https://launchpad.net/~webupd8team/+archive/java

网友评论

登录后评论
0/500
评论
adoryn
+ 关注