Sunday, January 24, 2016

How to install Oracle JDK on Lubuntu


There are two kind of JDK (Java Development Kit) available for lubuntu, the regular open JDK and the proprietary oracle JDK. I believe i already show you how to install open JDK on lubuntu, and now it's time for me to show you how to install oracle JDK on lubuntu.

If you already have open JDK, why you want oracle JDK? why do you need oracle JDK? good questions. It all because when i install android studio, there is a warning on the top right corner of the screen, saying that i should use oracle JDK instead of open JDK for better performance.

So that's the main reason why we should use oracle JDK instead of open JDK when developing android application with android studio. When using android studio i get some error related to rendering, perhaps it's because of open JDK but i'm not sure.

Anyway, let's go ahead install oracle JDK on lubuntu, oracle JDK is available on PPA launchpad so we need to add the PPA repository first. Open your terminal/console/command line, and then run this command to add oracle JDK PPA repo.

sudo apt-add-repository ppa:webupd8team/java

Before installing the JDK itself, we need to update the repo list on our lubuntu, so that it can located the repository of oracle JDK, simply by running the apt-get update.

sudo apt-get update

Finally we can install the oracle JDK using apt-get install command as usuall

sudo apt-get install oracle-java8-installer

Next you need to make sure that the JAVA_HOME variable is pointing at /usr/lib/jvm/java-8-oracle , to do that you can run this command: 

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

That's it, now you should have oracle JDK on your lubuntu, you might want to restart your computer so that the changes can take effect.

No comments:

Post a Comment