Computer Linux Rechnerkram

Installing Oracle JDK in Mint

When I installed the Android Developer Studio and started it, I got the message that OpenJDK has performance issues and that one should install the JDK/JRE by Oracle. Oracle offers only tar-balls and rpms, thus I needed to find a way to install it. Thanks to Google the solution wasn’t far away but for making it easier findable for me, I post the way I did it in the end here as well in a more generalized way.

Download the JDK from Oracle, then start by removing OpenJDK:

sudo apt-get update && apt-get remove "openjdk"

Then go to your downloads-directory and untar the tar.gz (tar -xzvf jdk-$version)

Create a folder in /opt for the jdk:

sudo mkdir -p /opt/java

Move the JDK to the folder:

sudo mv ~/Downloads/jdk$version /opt/java/

Make the JRE and JDK the default
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk$version/bin/java" 1

sudo update-alternatives --set java /opt/java/jdk§version/bin/java

sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/jdk$version/bin/javac" 1

sudo update-alternatives --set javac /opt/java/jdk§version/bin/javac

By nielsk

I am a sysadmin with a background in Japanese Science and economics. Thus my topics are computers, Japan and economics. My favorite past times are pen&paper-role playing games and old video games.

With a couple of friends I also podcast about retro video games in German: Retrozirkel

Leave a Reply

Your email address will not be published. Required fields are marked *