I installed Android Studio in Ubuntu by following two commands:
sudo apt-get ubuntu-make
umake android
It installed with OpenJDK bydefault using Ubuntu Developer Tool.
Now I want to change JDK from Open JDK to Oracle JDK. Should I do it? If yes, why? If not, then how do I change the JDK to Oracle?
Best Answer
Why choose Oracle Java?
Oracle Java is what most Java projects use. They test their products using it. They don't usually test their products on OpenJDK.
This means that bugs get fixed when they show up on Oracle Java. Bugs don't usually get fixed when they show up only on OpenJDK.
If you want a less buggy experience in general, Oracle Java is a better option.
Installing Oracle Java the nice way
Ubuntu's APT package manager makes it easy to install software, uninstall software, and update software. If you want these benefits with Oracle Java, do the following (replace
java8
with the version you want; for example, to get Java 9, installoracle-java9-installer
instead):To switch between installed JDKs
List Java alternatives:
Find the line with the Java you want.
Remember the first part of the line. For example, Oracle Java 8's line might look like this on your system:
The first part of the line there is
java-8-oracle
.Set the first part of the line you want as the Java alternative (replace
java-8-oracle
with the Java you want):