I already have java8 working but when I try to install java9 this is what happens everytime:
sudo apt-get install oracle-java9-installer
Reading package lists... Done Building dependency tree Reading state information... Done Package oracle-java9-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-java9-installer' has no installation candidate
It seems Oracle stopped supporting Java 9 so the PPA does not contain Java9 installer anymore. There is nothing wrong on your end, with your machine.
It looks like Java9 is a short-term support version, and so will java 10 be too. Java 11 will be a LTS support. For more details on the new Java release approach see this answer .
Because this, you can't install Java9 using the ppm anymore, you have to do it manually. You will have to go to the java 9 archive downloads , log in with an Oracle account, download the .tar.gz, extract the .tar.gz and copy it to the install location.
做
sudo apt install default-jre default-jdk
This likely happened because the "prerequisites" were not set.
Try using:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java9-installer
Once this is done, edit the system environment variables:
sudo nano /etc/environment
Then add this to the file:
JAVA_HOME="/usr/lib/jvm/java-9-oracle"
I believe this will only work on Ubuntu 16.04.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.