Ubuntu Install Zulu Java

Posted on

I would like to upgrade my main system to 16.04, but I work on projects that require OpenJDK 7.

Apparently it is not available from a trivial apt-get install openjdk-7-jdk. Only versions 8 and 9 are listed in the repository.

Can anyone point me to instructions on how to install it?

Anwar
58.5k24 gold badges155 silver badges260 bronze badges
onairdaonairda
2,1943 gold badges7 silver badges8 bronze badges

Apr 19, 2019  Download and install the Azul Zulu JDKs from a Yum repository. The Azul Zulu JDKs are provided in a Yum repository by Azul. To install the Azul Zulu JDK for Java 8, run the following commands from your CLI. We will be installing the latest version of Oracle Java SE Development Kit (JDK) on Ubuntu 18.04 Bionic Beaver Linux. This will be performed in three ways: Installing Java using the Ubuntu Open JDK binaries, installing Java via PPA and installing Java using the official Oracle Java binaries. Home coding, debian, java, mac os, windows Zulu – Certified OpenJDK 8 builds for all operating systems Zulu – Certified OpenJDK 8 builds for all operating systems May 5, 2015 oldo Leave a comment Go to comments.

7 Answers

Security Warning

Packages in the PPA mentioned below are not updated with security patches to Java. Do not use in production; see alternative answers instead.

At time of writing, the last upload for OpenJDK 7 was done '2016-04-22' with version 7u95 and still available as 'latest', where Ubuntu 14.04 has been updated to 7u181.

UPDATE : ALTHOUGH THIS IS THE MOST VOTED ANSWER ITS PROBABLY NOT THE ONE YOU WANT TO USE IN 2018 DUE TO LACK OF SECURITY UPDATES BY THIS PPA.

I found the following instructions which worked for me :

This defines the “PPA for OpenJDK uploads (restricted)” as an additional package repositiory, updates your information, and installs the package with its dependencies (from that repository).

onairdaonairda
2,1943 gold badges7 silver badges8 bronze badges

It does not look like the maintainer of openjdk-r/ppa will be updating the openjdk-7 package beyond version 7u95-2.6.4-3. That package's description 'Copied from debian experimental in Primary Archive for Debian GNU/Linux' gives us a clue about how to handle this ourselves, though.

Option 1: Manual Installation

Ubuntu install zulu java download
  1. Download the packages intended for your architecture:
    (for most users, this means amd64 if 64bit, or i386 if 32bit Ubuntu is installed)

    • libfontconfig1 (only Ubuntu 17.10 and earlier; see note at bottom)
    • fontconfig-config (only Ubuntu 17.10 and earlier; see note at bottom)
  2. (Attempt to) install the packages using dpkg:

    Ubuntu 17.10 and earlier:

    Ubuntu 18.04 and later:

  3. Check the output from dpkg. If there were dependency problems – which is likely – you will see the following (with your architecture substituted for amd64):

    If there were no dependency issues, great, you're done, skip to #4. Otherwise, if you need to resolve some dependency issues, this is handled with:

    Notice, there is no need to re-run dpkg after letting apt resolve dependencies. It will automatically finish installation of the openjdk packages.

  4. Update java alternatives. You can view all installed java versions with update-java-alternatives --list. To activate OpenJDK Java 1.7, run:

    You may notice an error about the IcedTeaPlugin.so plugin being unavailable. This isn't a real concern for developers working with the JDK.

  5. Verify java is working:

    which should output something similar to:

Option 2: Automatic Installation (including updates with apt)

Pinning can be utilized to install and update openjdk-7-jdk and its dependencies from Debian repositories.

  1. Create a pinning file that tells apt to only consider packages that interest us (we certainly don't want our entire Ubuntu distribution 'upgraded' with Debian experimental packages).

    Create file /etc/apt/preferences.d/debian with the below contents. You'll need superuser privileges, so use one of sudo vim, sudo nano, gksudo gedit, etc.

    For Ubuntu 17.10 and earlier, also append the following (and see note at bottom):

  2. Install the Debian keyring:

    Note: while this is the simplest method of adding the debian keyring, it may not be up to date. Check for output like the following when running apt update in step 4:

    If you see this error, then manually add the necessary keys with:

    where 8B48AD6246925553 and 7638D0442B90D010 should match the pubkeys you see in the warning message.

  3. Add the needed repositories:

    Why not use a stable Debian repository? You'll run into unsatisfiable dependencies with Debian stable. The experimental (for openjdk-7) and sid (for libjpeg62-turbo, libfontconfig1, and fontconfig-config) repositories are more lenient with dependency versions.

  4. Update apt cache (expect this to take a while since Debian's package lists are big):

  5. Install openjdk-7-jdk:

  6. Update java alternatives. You can view all installed java versions with update-java-alternatives --list. To activate OpenJDK Java 1.7, run:

    You may notice an error about the IcedTeaPlugin.so plugin being unavailable. This isn't a real concern for developers working with the JDK.

  7. Verify java is working:

    which should output something similar to:

fontconfig notes

libfontconfig1 and fontconfig-config must be upgraded to 2.12 or later on Ubuntu 17.10 and earlier. The update packages from Debian do not contain Ubuntu's customizations, so some applications display ugly fonts with these packages installed; e.g. Charles Web Debugging Proxy. Depending on the programs you use, you may or may not be affected by this problem.

MDMowerMDMower

You can download a OpenJDK 7 from Azul which may fit your needs. They both have a DEB (for the package system) and a ZIP distribution. I have only worked with the ZIP distribution.

Thorbjørn Ravn AndersenThorbjørn Ravn Andersen
2,3583 gold badges15 silver badges26 bronze badges

Install Java 7 on Ubuntu 16.04, Ubuntu 17.04

Ubuntu Install Zulu Java

It’s recommended to install Oracle Java, because it has a performance edge over OpenJDK. For that reason I want to post an alternative. If you want to install Oracle Java run the following commands in terminal to install it from PPA.

  1. Add the needed repositories:

  2. Update apt cache and install oracle-java7:

    During the installation process you will need to accept the Oracle License agreement. Once installed we need to set Java environment variables such as JAVA_HOME

  3. Correct Java environment variables.

  4. Verify java is working:

    which should output something similar to:

TeocciTeocci
1,5472 gold badges6 silver badges8 bronze badges

Oracle JDK alternative:

I wanted to avoid the effort with repositories because I switch between 7, 8, and 9, so I ended up with Oracle JDK rather than OpenJDK. Downloaded from the official site. I am not sure about whether the latest build 80 contains the same fixes as OpenJDK's build 161. But I have it for development so that doesn't mean much anyway to me.

Then you need to set $JAVA_HOME in the environment so that various scripts pick up the right JDK (e.g. Maven, JBoss etc.).

For completeness, JDK version 7 was EOL'ed, even JDK 8 public support is being terminated since September 2017 and will get no public updates after September 2018.

Ondra Žižka

Ubuntu Install Zulu Java Server

Ondra Žižka
9791 gold badge14 silver badges29 bronze badges

Use containers

This is a universally valid answer on how to run <outdated> removed software on <current> Ubuntu: containerize your application.

For example, use Docker and an older Ubuntu base image in which the software you're looking for is still available/maintained.

It also works the other way around; try out the software on a newer or even other Linux distribution on your currently running stable Ubuntu.

Example for Java 7 using Ubuntu 14.04

  1. Install Docker - Docker CE free version is fine. See for example https://docs.docker.com/install/linux/docker-ce/ubuntu/ or use the docker.io package in recent Ubuntu versions shipped.

  2. In an empty folder, create a file Dockerfile:

    Add more packages in that command if you need that.

  3. In that folder, run:

  4. Run a command inside a single-use-container using that Java 7 image:

    E.g. java -version:

    Output:

  5. Optionally, create a wrapper for convenience.

    • Create a file /usr/local/bin/java7-in-docker with contents:

      This will make the current working directory available inside the container - not your whole filesystem, and it will impersonate your local user account in the container namespace.

    • Mark it as executable:

  6. Run your Java 7 transparently, like this:

gertvdijkgertvdijk
52.3k18 gold badges148 silver badges243 bronze badges

An easy way is:

Add these lines to: /etc/apt/sources.list:

Then update apt and install. You will probably need to downgrade tzdata package.

After that, I would recommend to comment out those lines and apt update again to prevent install or update of packages from that repository (which could lead to unexpected behavior).

One problem is that you need to hold those packages so they don't get removed when you update your system (specially tzdata package).

NOTE: Use this method as last resort, prefer any other that will allow you to update without issues.

lepelepe
8512 gold badges17 silver badges33 bronze badges

Not the answer you're looking for? Browse other questions tagged javaopenjdk or ask your own question.

Categories: Ubuntu

Install Zulu Java Ubuntu

In other languages:

Install Java In Ubuntu 19.04

Español: instalar Oracle Java JDK en Ubuntu Linux, Português: Instalar o Oracle Java JDK no Linux Ubuntu, Italiano: Installare Oracle Java JDK su Ubuntu Linux, Русский: установить Oracle Java JDK на Ubuntu Linux, Deutsch: Oracle Java JDK unter Ubuntu Linux installieren, Français: installer Oracle Java JDK sur Ubuntu Linux, ไทย: ติดตั้ง Oracle Java JDK ใน Ubuntu Linux, Bahasa Indonesia: Menginstal Oracle Java JDK di Ubuntu Linux, Nederlands: Oracle Java JDK installeren in Ubuntu Linux, Tiếng Việt: Cài đặt Oracle Java JDK trên hệ điều hành Ubuntu Linux, العربية: تثبيت أوراكل جافا جى دي كي على نظام أوبنتو لينكس, 한국어: 우분투에 오라클 자바 JDK 설치하는 법, हिन्दी: उबुन्टु लिनक्स पर ओरेकल जावा जीडेके (Oracle Java JDK) इंस्टॉल करें, 中文: 在Ubuntu Linux上安装Oracle Java JDK

  • Print
  • Edit
  • Send fan mail to authors