Installing openjdk-7 on Ubuntu 18.04 That Works!

Опубликовано: 31 Октябрь 2024
на канале: AlaskaLinuxUser AKLU
9,303
44

Installing openjdk-7 on Ubuntu 18.04 is tricky, here is a link to how to get it done:
https://askubuntu.com/questions/76112...

And the instructions, as promised:

"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

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

openjdk-7-jdk
openjdk-7-jre
openjdk-7-jre-headless
libjpeg62-turbo
libfontconfig1 (only Ubuntu 17.10 and earlier; see note at bottom)
fontconfig-config (only Ubuntu 17.10 and earlier; see note at bottom)
(Attempt to) install the packages using dpkg:

Ubuntu 17.10 and earlier:

sudo dpkg i openjdk-7* libjpeg62-turbo* libfontconfig1* fontconfig-config*
Ubuntu 18.04 and later:

sudo dpkg i openjdk-7* libjpeg62-turbo*
Check the output from dpkg. If there were dependency problems – which is likely – you will see the following (with your architecture substituted for amd64):

Errors were encountered while processing:
openjdk-7-jre:amd64
openjdk-7-jre-headless:amd64
openjdk-7-jdk: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:

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

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

sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
You may notice an error about the IcedTeaPlugin.so plugin being unavailable. This isn't a real concern for developers working with the JDK.

Verify java is working:

java -version
which should output something similar to:

java version "1.7.0_161"
OpenJDK Runtime Environment (IcedTea 2.6.12) (7u161-2.6.12-1)
OpenJDK 64-Bit Server VM (build 24.161-b01, mixed mode)"
================================================

Welcome to my YouTube Channel!

Need help compiling? Go here:
https://forum.xda-developers.com/andr...

I also want to provide you with a few links to help you get started:

Wordpress: https://thealaskalinuxuser.wordpress.com
XDA: https://forum.xda-developers.com/andr...
GitLab: https://gitlab.com/alaskalinuxuser
GitHub: https://github.com/alaskalinuxuser

If you really appreciate the content on this channel, or my custom roms, custom kernels, tutorials, or apps, please feel free to contribute to support purchasing more phones, tablets, internet, and other equipment used for compiling!
Donation: https://www.paypal.me/TheAlaskaLinuxU...