$ sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
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
Asked
Active
Viewed 2,087 times
1
Soren A
- 6,442
- 2
- 17
- 33
Bhagyashri Ghode
- 11
- 5
-
Have you added the repository ? `sudo add-apt-repository ppa:webupd8team/java` and refreshed package database `sudo apt update` before trying to install ? – Soren A May 01 '19 at 09:21
-
@SorenA This repository has been discontinued – Kulfy May 01 '19 at 09:30
-
Yes,i have added and also refreshed package database. – Bhagyashri Ghode May 01 '19 at 09:32
-
@Kulfy,I also read that this repository has been discontinued.but will you please tell me then how to install it,i need this for my project. – Bhagyashri Ghode May 01 '19 at 09:34
-
Have you tried downloading it from [here](https://www.oracle.com/technetwork/java/javase/overview/java8-2100321.html) – Nomi Shaw May 01 '19 at 09:38
-
You need to download it from oracle's site and follow the instructions [here](https://askubuntu.com/a/55960/816190) – Kulfy May 01 '19 at 09:40
2 Answers
0
I still use java version 8 and follow these steps to install via command line whenever I nuke an OS
add the discontinued repository, it will automatically install the repository for the newer version but will not prevent you from installing previous versions of java
sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update
install java version 8 default, jre or jdk
sudo apt-get install oracle-java8-set-default
# or
sudo apt install openjdk-8-jdk
# or
sudo apt install openjdk-8-jre
verify your version of java
java -version
set your environment variables
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
Andrew Judell
- 1
- 1
0
Oracle recently changed the licensing for their JDK/JRE to require everybody to have a subscription to get newer releases than 8u201. You can either switch to another JDK or buy the subscription and download/install the new oracle-jdk package manually.
Most software should run fine with openjdk-8-* - this might therefore be a worthwhile first test.
Phillip -Zyan K Lee- Stockmann
- 2,303
- 12
- 26