I have jdk 8 on my ubuntu desktop. I need to install the latest jdk 9 for Java programming. What are the commands for Java programming and IDE such as Netbeans or Eclipse?
Asked
Active
Viewed 1.9k times
2 Answers
15
Install
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java9-installer
Update your environment variable after that
sudo nano /etc/environment
Add / Edit this line
JAVA_HOME="/usr/lib/jvm/java-9-oracle"
Save and run
source /etc/environment
Test if environment variable was set
echo $JAVA_HOME
(Optional) For Linux Mint Users:
sudo apt install gsfonts-x11 oracle-java9-set-default
Update: Oracle Java 9 has reached end of life. Users of Java SE 9 should switch to Java SE 10. Source
To install Java 10, follow this.
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java10-installer
Sirajus Salekin
- 1,677
- 12
- 28
-
should we add JRE also to `/etc/environment`? – Stav Alfi Jan 14 '18 at 12:45
-
1not necessary :) – Sirajus Salekin Jan 16 '18 at 02:22
-
5Update: Oracle Java 9 has reached end of life: [Read](http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html) – Sirajus Salekin Apr 23 '18 at 06:14
2
You can see which versions are available in your PPA's:
sudo apt-cache search java-sdk
If you want something else that this is suggest using SdkMan
https://sdkman.io
After install see what it can give you by:
sdk list java
Max Robbertze
- 1,619
- 1
- 13
- 10