How To Manually Install Oracle Java on Ubuntu

Introduction


Java is a programming technology originally developed by Sun Microsystems and
later acquired by Oracle. Oracle Java is a proprietary implementation for Java
that is free to download and use for commercial use, but not to redistribute,
therefore it is not included in a officially maintained repository.

There are many reasons why you would want to install Oracle Java over
OpenJDK. In this tutorial, we will not discuss the differences between the above
mentioned implementations.

Assumptions

This tutorial assumes that you have an account with DigitalOcean, as well as
a Droplet running Debian 7 or Ubuntu 12.04 or above. You will need root
privileges (via sudo) to complete the tutorial.

You will need to know whether you are running a 32 bit or a 64 bit OS:


[email protected]:/usr/local/java/jdk1.8.0_05$ uname -m
i686

  • x86_64: 64 bit kernel

  • i686: 32 bit kernel

Downloading Oracle Java JDK

Using your web browser, go to the Oracle
Java SE (Standard Edition) website
and decide which version you want to
install:

  • JDK: Java Development Kit. Includes a complete JRE plus
    tools for developing, debugging, and monitoring Java applications.

  • Server JRE: Java Runtime Environment. For deploying Java
    applications on servers. Includes tools for JVM monitoring and tools commonly
    required for server applications.

In this tutorial we will be installing the JDK Java SE Development Kit 8 x64
bits. Accept the license and copy the download link into your
clipboard. Remember to choose the right tar.gz (64 or 32 bits).
Use wget to download the archive into your server:


wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-i586.tar.gz

Oracle does not allow downloads without accepting their license, therefore we
needed to modify the header of our request. Alternatively, you can just download
the compressed file using your browser and manually upload it using a SFTP/FTP
client.

Always get the latest version from Oracle‘s website and
modify the commands from this tutorial accordingly to your downloaded file.

Or U can visit the website
directly and download the tar.gz file do not  visa the command .

Installing Oracle JDK


In this section, you will need sudo privileges:

sudo 


sudo mkdir -p /usr/local/java 


cd /home/"your_user_name"/Downloads
sudo cp -r jdk-8u5-linux-i586.tar.gz /usr/local/java/
cd /usr/local/java
sudo tar xvzf jdk-8u5-linux-i586.tar.gz

Setting Oracle JDK as the default JVM

In our case, the java executable is located under
/usr/local/java/jdk1.8.0_05/bin/java . To set it as the default
JVM in your machine run:


 sudo  update-alternatives --install /usr/bin/java java  /usr/local/java/jdk1.8.0_05/bin/java 100
sudo update-alternatives --install /usr/bin/javac javac  /usr/local/java/jdk1.8.0_05/bin/javac 100

Verify your installation

Verify that java has been successfully configured by running:


update-alternatives --display java


update-alternatives --display javac

The output should look like this:


java - auto mode
link currently points to /usr/local/java/jdk1.8.0_05/bin/java
/usr/local/java/jdk1.8.0_05/bin/java - priority 100
Current ‘best‘ version is ‘/usr/local/java/jdk1.8.0_05/bin/java‘.


javac - auto mode
link currently points to /usr/local/java/jdk1.8.0_05/bin/javac
/usr/local/java/jdk1.8.0_05/bin/javac - priority 100
Current ‘best‘ version is ‘/usr/local/java/jdk1.8.0_05/bin/javac‘.

Another easy way to check your installation is:


java -version

How To Manually Install Oracle Java on Ubuntu,布布扣,bubuko.com

时间: 2024-12-21 19:13:11

How To Manually Install Oracle Java on Ubuntu的相关文章

HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits

安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章. 成功安装的关键点:install additional packages, 在link过程中处理错误的方法. 原文:http://www.makina-corpus.org/blog/howto-install-oracle-11g-ubuntu-linux-1204-precise-pangolin-64bits Before

Install Oracle Java JDK/JRE 7u55 on Fedora 20/19, CentOS/RHEL 6.5/5.10

What's new in Sun/Oracle Java 7 VM Compressed 64-bit object pointers Garbage-First GC (G1) JSR 292: VM support for non-Java languages (InvokeDynamic) Lang JSR 294: Language and VM support for modular programming JSR 308: Annotations on Java types JSR

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

oracle java for ubuntu apt-get

oracle java PPA: ppa:webupd8team/javathe key word use for search more infomation: webupd8team

Install Oracle jdk8 in Ubuntu 16.04 LTS

1.add repository apt add-repository ppa:webupd8team/java 2.update apt update 3.install apt install oracle-java8* 原文地址:http://blog.51cto.com/qwfys200/2071587

ubuntu安装oracle java

通常UBUNTU源中带有openjava,但在使用eclipse与android studio时经常会有莫名奇妙的问题,所以个人觉得还是用oracle java,省点心. 安装步骤如下: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer 自动化设置JAVA环境变量JAVA_HOME和PATH: sudo apt-get insta

Ubuntu 12.04, 14.04 安装 oracle java

第一步:如果系统中已安装了open java,需要清理, 反之 略过此过程 sudo apt-get purge openjdk* 第二步: 安装 sudo apt-get install software-properties-common 第三步: 添加信任的软件源: sudo add-apt-repository ppa:webupd8team/java 第四步,更新 sudo apt-get update 第五步: 安装java java6 sudo apt-get install or

Ubuntu上安装oracle java 7

1.通过PPA 这种安装方式特点: 1.安装的java含jdk.jre和浏览器插件 2.自动识别64bit或者32bit 3.自动升级为最新版本 4.支持 Ubuntu 13.10, 13.04, 12.10, 12.04 and 10.04 或  Linux Mint 1.1在终端中执行安装命令: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-

Install JDK 8 on Ubuntu 14.04

Ubuntu Trusty (14.04 LTS). OpenJDK 8 is not available on Trusty. To install Oracle JDK 8: $ sudo apt-get install software-properties-common swig$ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-i