Installing Adoptium Eclipse Temurin 17 on Ubuntu 22.04java
The "Eclipse Temurin" recommend for OpenJDK binary distribution. It was released by Eclipse Adoptium which was before known as AdoptOpenJDK. If you are still confused about OpenJDK binary distribution, read this post.
I will guide you in installing Eclipse Temurin version 17, which is the latest LTS version, on Ubuntu 22.04. From the start till you could run the Java commands on the Terminal.
I also made an article for different Operating Systems:
Download and Install Eclipse Temurin
First, get the Eclipse Temurin installer from the Adoptium Website. The download button will choose an installer based on your Operating System. So, make sure to download .tar.gz file.
When it’s done, extract it.
$ cd Downloads $ tar -xvzf OpenJDK17U-jdk_x64_linux_hotspot_184.108.40.206_1.tar.gz
Move to /opt
At this point, you could place the JDK folder anywhere.
But, I prefer to put it under
Plus rename the folder from
Trust me, it will help you later.
$ sudo mv jdk-220.127.116.11+1/ /opt/jdk-17
Set Up Environment Variables
Create a file with the name
$ sudo nano /etc/profile.d/jdk.sh
Fill the file with this value:
export JAVA_HOME=/opt/jdk-17 export PATH=$PATH:$JAVA_HOME/bin
Note: Remember when I mention renaming the folder? If you’re not following my advice, pay attention to using the correct folder name. I assume it should be jdk-18.104.22.168+1.
Last, you need to re-initiate the profile in order for the new Java environment set up recognized.
Now, you can verify the JAVA_HOME and java command on your Terminal.
If you have any comments or corrections please feel free to email them to me. Also, if you found any of the content on this website useful consider buy me a coffee ;)