Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

751
Views
Install openJDK+openJFX 8 on Ubuntu 20

I'm trying to install OpenJDK 8 and OpenJFX 8 on Ubuntu 20.10.

Installing openJFX 8 has always been a little tricky on Ubuntu, but I used to be able to do it using the tip from this SO answer: https://stackoverflow.com/a/56166582/2423283 That used to work fine (I think I was using Ubuntu 19.something), however it appears that recently 8u161-b12-1ubuntu2 was removed.

For some more background information, I'm installing this via a docker file in an automated pipeline. Here are the relevant parts of the Dockerfile:

FROM my.company.internal.registry:443/ubuntu:latest

RUN apt -y update && \
    apt -y install \
    openjdk-8-jdk \
    openjfx=8u161-b12-1ubuntu2 \
    libopenjfx-java=8u161-b12-1ubuntu2 \
    libopenjfx-jni=8u161-b12-1ubuntu2

This used to run just fine, but now I get:

E: Version '8u161-b12-1ubuntu2' for 'openjfx' was not found
E: Version '8u161-b12-1ubuntu2' for 'libopenjfx-java' was not found
E: Version '8u161-b12-1ubuntu2' for 'libopenjfx-jni' was not found

What I've tried so far

I've tried changing my ubuntu:latest to ubuntu:19:10 in my FROM line in the Dockerfile, but I still got the missing packages errors.

I tried just removing those version restrictions (the =8u161-b12-1ubuntu2) and I didn't see any errors during the installation, but then when I compiled my code, none of the JavaFX classes could be found.

over 4 years ago · Santiago Trujillo
4 answers
Answer question

0

I stumbled upon the same problem and found that the easiest solution is to use sdkman: https://sdkman.io/install

With these three commands I was able to have openjdk 8 with JavaFX installed on Ubuntu 20.04:

curl -s "https://get.sdkman.io" | bash

source "$HOME/.sdkman/bin/sdkman-init.sh"

sdk install java 8.0.252.fx-zulu

over 4 years ago · Santiago Trujillo Report

0

If you are set on using JDK 8 and JavaFX, I've found it's best to install an OpenJDK that includes JavaFX.

For version 8, not all OpenJDKs include JavaFX (e.g. AdoptOpenJDK). The best ones I have found are

  • Zulu : You must select "JDK FX" in the Java Package drop down
  • Liberica: You must select "Full JDK"

Liberica provides builds for raspberry pi and a wide variety of other architectures. If you need that, Liberica is the way to go.

over 4 years ago · Santiago Trujillo Report

0

Use Oracle JDK (even if only as a temporary workaround)

I already said this just now in an answer to this question for 18.04

For any learners looking for a bit of basic practice with javafx, installing Oracle's Java 8 (which has javafx built-in) might be a better solution then messing about with open packages. There are great instructions here

You can continue efforts getting openjfx installed, but this will keep your learning going.

I don't know anything about docker files and automated pipelines, but I suspect a lot of people who come to this question are just early learners doing a manual installation.

NB this workaround has already been suggested by aran in a comment to the OP, please consider upvoting that comment.

over 4 years ago · Santiago Trujillo Report

0

Install Liberica JDK / JRE via Aptitude

Liberica JDK is quite easy to install on Ubuntu / Debian based operating systems which support the aptitude package manager.

All you have to do is to add the official BellSoft repository:

wget -q -O - "https://download.bell-sw.com/pki/GPG-KEY-bellsoft" | sudo apt-key add -
echo "deb [arch=amd64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list

And after that update your packages and install the full bellsoft java version. It is important that you use the full version, as it is the only one coming with JFX. Also bear in mind that you should uninstall all previously installed java versions via apt purge before installing this java version.

sudo apt-get update
sudo apt-get install bellsoft-java8-full

You can use bellsoft-java8-runtime-full to safe some space if you only need the JRE. After the installation is completed applications using JavaFX work just fine.

In case you are not using the Ubuntu repository because you are using Debian for example you need to enter the following command to make sure there is no verification error on apt update for the Bellsoft repository.

#Use this only in case there is a verification error on update
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 32E9750179FCEA62

If you are not using an operating system with the aptitude package manager there are also some other package managers like yum and yast supported. Click here

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!