资讯专栏INFORMATION COLUMN

Install Java 8 on Ubuntu

DoINsiSt / 216人阅读

摘要:

In this article, we will learn how to install Java 8 on Ubuntu OS. We will install JDK in Ubuntu. Java is a programming technology which is actually developed by Sun Microsystems. Java is free to download and use for commercial use.

Install Java 8 on Ubuntu
How to Install Java 8 on Ubuntu?

i) At first, we will download the package file from the official website.

http://www.oracle.com/technet... The download package is different for 64 bit and 32-bit versions.

ii) We will need some superuser privileges to install JDK. So we will use the following command-
sudo su

iii) The /opt directory is actually reserved for all the software and add-on packages. This software is not part of the default installation. The command for creating the directory for JDK installation is-

mkdir /opt/jdk

Creating a directory for JDK installation

iv) Then we will extract java into the /opt/jdk directory:

tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk

Extract java into the /opt/jdk directory

v) Then we use the following command. This command verifies the file extraction into the /opt/jdk directory.

ls /opt/jdk

Verifies the file extraction into the /opt/jdk directory

vi) By default, we can find java executable in /opt/jdk/jdk1.8.0_05/bin/java directory. To set it as the default JVM we will use:

update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100


Set the default JVM

Set the default JVM

vii) Then verify the java has been successfully configured. Run the following command-

update-alternatives --display java
update-alternatives --display javac



Verify the java has been successfully configured

Verify the java has been successfully configured

We can check installation by-

java -version

Check installation by java -version

viii) We can also update Java. Hence, download an updated version of Oracle’s website and extract to the /opt/jdk directory. After that, set it as the default JVM with a higher priority number:

update-alternatives --install /usr/bin/java java /opt/jdk/jdk.new.version/bin/java 110
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk.new.version/bin/javac 110

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/68717.html

相关文章

  • Install Java 8 on Ubuntu

    摘要: In this article, we will learn how to install Java 8 on Ubuntu OS. We will install JDK in Ubuntu. Java is a programming technology which is actually developed by Sun Microsystems. Java is free ...

    source 评论0 收藏0
  • sonarqube For PHP 代码质量管理

    摘要:如果有报错官方文档即可是时候来张图了具体的和汉化,可以通过页面对应的插件。 下载jdk&sonarqube&sonar-scanner 安装jdk 基于ubuntu 16.04+apache[具体webserver采用缺省安装]推荐下载安装【底部有网盘地址】 sonarqube-5.6.6.zip jdk-8u121-linux-x64.tar.gz sonar-scanner-2...

    hzc 评论0 收藏0
  • Ubuntu准备+MySQL+Java

    摘要:服务器准备安装系统修改用户密码修改账户密码退出当前账号并重新登录如果需要关机使用命令更新所有的开发包配置相关的编译包配置编译工具同步服务器时间时区配置选择亚洲中国北京确认配置进行时间同步安装工具与时间服务器同步 Linux服务器准备 1 . 安装Ubuntu系统 2 . 修改root用户密码 sudo passwd root #修改root账户密码 logout ...

    Rango 评论0 收藏0
  • 我的面试准备过程--ubuntu使用过程记录

    回到监狱般的实验室,用一台4年前的废电脑,装一个ubuntu来玩玩吧。 插播一段广告 页面下载器(我的Java爬虫之一) https://segmentfault.com/a/11...Xpath、Jsoup、Xsoup(我的Java爬虫之二)https://segmentfault.com/a/11... 问题1 ubuntu 14.04 --系统的网络服务与此版本的网络管理器不兼容问题 1、s...

    msup 评论0 收藏0
  • Django之Ubuntu环境搭建

    一、Ubuntu的安装 建议: 在断网情况下安装会比较快! 二、VMware Tools安装 虚拟机选项 安装VMware Tools - 将VMwareTools-xx.tar.gz拷贝到桌面 - 文件解压(切换到桌面目录) tar -zxvf VMwareTools-xx.tar.gz - 安装(切换到vmware-tools-xxx) sudo ./vmwar...

    import. 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<