Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly install Oracle Java 8 on Ubuntu?

Tags:

java

java-8

I would like to install Oracle Java 8 on my Ubuntu 18.04 using packages. I already added the apt-repository, but when trying to install it says package is not available. All I do is:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Then it says:

Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'oracle-java8-installer' has no installation candidate

Maybe the package has already been deleted and is not available now?

like image 999
Orbit09 Avatar asked Apr 20 '19 08:04

Orbit09


People also ask

Can I install Java 8 Ubuntu?

Step 1 – Install Java 8 on Ubuntu The OpenJDK 8 is available under default Apt repositories. You can simply install Java 8 on an Ubuntu system using the following commands. Run below commands to install Java 8 on Ubuntu and LinuxMint.


2 Answers

sudo apt install openjdk-8-jdk openjfx should do the trick. It will get you JavaFX for OpenJDK.

Read more at https://askubuntu.com/questions/1091157/javafx-missing-ubuntu-18-04

like image 115
Doc Avatar answered Sep 19 '22 14:09

Doc


Others have mentioned to install openjdk-8.
After that---> Get jfxrt.jar file from https://github.com/qweasdzxcpoi/JavaFX
Do sudo nautilus.
And put it in your /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext
This personally worked for me when all the other commands were not working for some reason idk.
After that rebuild your project.

like image 32
Rahul Avatar answered Sep 18 '22 14:09

Rahul