Install Oracle Java 10 In Ubuntu Or Linux Mint From PPA Repository

Oracle Java Development Kit 10 includes new features like:
  • an experimental just-in-time compiler called Graal can be used on the Linux/x64 platform
  • local-variable type inference.
  • application class-data sharing, which allows app classes to be placed in the shared archive to reduce startup and footprint of Java applications.
  • Docker awareness - on Linux, JVM now automatically detects if running in a Docker container
  • various other changes.

Oracle Java 10 for Linux has been out for some time, and seeing that Andrew hasn't updated the Java PPA (Personal Package Archive) with the new version, I decided to create a single repository PPA for it myself (Oracle Java is the only package in the PPA). My package is pretty much the same as the Java 9 and 8 packages from the WebUpd8 Java PPA, the only change being that it was updated to install Oracle Java 10 (JDK 10).

Oracle provides Java (JDK) 10 for 64bit only. As a result, using the Oracle Java 10 package in our PPA will only work on 64bit, so don't try to add the PPA to your software sources or install it on 32bit or ARM because it won't work!

The PPA package installs Oracle JDK 10 for Linux, which includes the JRE bin Java folder, so installing this package gets you both JDK and JRE. In some old Linux versions, the JRE bin Java folder was available in JDK, but in a separate folder. This Oracle Java version uses the same folder for all executables, be it JDK or JRE, and there's no need to install JRE separately.

Install Oracle Java 10 (JDK 10) in Ubuntu or Linux Mint from PPA


Oracle Java 10 installer ubuntu

For Debian, see the instructions from our Debian Oracle JDK 10 article.

To add the LinuxUprising Java PPA repository to your software sources and install Oracle Java 10 in Ubuntu or Linux Mint (64bit only) you can use the commands below:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java10-installer

After adding our Oracle Java PPA to your software sources and installing Java, here's how to make it default. Don't worry though, there's no need to manually run commands like sudo update-alternatives --config java or anything like that.

In Ubuntu, Oracle Java 10 should be automatically set as default. In other Linux distributions, like Linux Mint, you can make Oracle JDK 10 for Linux as default by installing the oracle-java10-set-default package:

sudo apt install oracle-java10-set-default

If you want to have Oracle Java 10 installed but not set it as the default Java, make sure the oracle-java10-set-default package is not installed / removed:

sudo apt remove oracle-java10-set-default

You can check to see if Oracle Java 10 is set as default by checking your current Java version using the following command:

java -version

If Oracle Java 10 is default, you should see an output similar to the following:

java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

You can try it for javac as well:

javac -version

Which should return an output similar to the one below:

javac 10

Just like the original package, my Oracle Java 10 package supports installing Java by downloading the archive manually. This is useful in case you're behind a firewall or your ISP somehow blocks the Oracle JDK 10 download link. To do this, download the Oracle Java 10 tar.gz archive and place it in the /var/cache/oracle-jdk10-installer folder. Next, install the oracle-java10-installer package and it should pick up the downloaded tar.gz archive instead of downloading it by itself.

Automatically accept the Oracle Java 10 lincense (for automated installations)


By default, the Oracle Java 10 installer prompts you to accept the Oracle Java license before proceeding with the JDK 10 installation. If you want to automate the Oracle Java 10 installation process, use the following command to automatically accept the license:

echo oracle-java10-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections

If the command above doesn't automatically accepts the Oracle Java 10 license, try the command below instead:

echo oracle-java10-installer shared/accepted-oracle-licence-v1-1 boolean true | sudo /usr/bin/debconf-set-selections

9 comments:

  1. Thanks for the package. Why does it conflict with the openjdk java?

    sudo apt install openjdk-11-jre
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following package was automatically installed and is no longer required:
    gsfonts-x11
    Use 'sudo apt autoremove' to remove it.
    The following additional packages will be installed:
    openjdk-11-jre-headless
    Suggested packages:
    fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
    | fonts-wqy-zenhei
    The following packages will be REMOVED:
    oracle-java10-installer
    The following NEW packages will be installed:
    openjdk-11-jre openjdk-11-jre-headless
    0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
    Need to get 39.6 MB of archives.
    After this operation, 183 MB of additional disk space will be used.
    Do you want to continue? [Y/n]

    ReplyDelete
    Replies
    1. I don't know, the conflict is not added in my package, but in the openjdk package.

      Delete
    2. After some investigation, it looks like the oracle-java-8-installer and probably java-9 as well (which is what I've used to create this new pacckage), automatically incremented the Java priority a while back. The old Oracle Java 8 package mentions: "The priority is no longer incremented by the package (due to complaints by the Debian packagers)".

      That changelog line is from 2016, so that's when it was fixed by the original packager, and thus, it should be fixed in this oracle-java10-installer as well. I guess the Debian maintainers never got the memo...

      Delete
  2. Replies
    1. All I can say is that it is safe, but I'm not sure how to prove that. I mean, security issues can occur even with the official Ubuntu Snap Store: https://www.linuxuprising.com/2018/05/malware-found-in-ubuntu-snap-store.html ...

      This PPA uses the exact same scripts as the Oracle Java WebUpd8 PPA, but modified by me to install Oracle Java 10.

      Delete
    2. What I can prove is that the PPA has many users (currently about 27700) and I didn't get any complaints so far :-) Here's a screenshot: https://imgur.com/a/NdeHK3R

      You can check this for yourself by using the python script from here, which displays the PPA usage statistics. To use it, install python-launchpadlib and python-tabulate:

      sudo apt install python-launchpadlib python-tabulate

      Now you can see the usage statistics for the Linux Uprising Java PPA with:

      python ppastats.py linuxuprising java

      That's all I could think of. I'm not sure what else I can do...

      Delete
    3. I was linked here from the WebUpd8 team, which is official Canonical. That's trustworthy for me.

      Delete

Powered by Blogger.