I took an Android application development course a few months ago and I had to install JDK along with Android Studio and Eclipse. I removed those applications from my computer but when I check my java version and I run the update-alternative command I get the following response. Should I have two versions of java installed at the same time?
bryan@FamilyDesktop:~> java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (IcedTea 3.3.0) (suse-21.4-x86_64)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
bryan@FamilyDesktop:~> sudo update-alternatives --config java
root's password:
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java 1805 auto mode
1 /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java 1705 manual mode
2 /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java 1805 manual mode
What you’re seeing is acceptable,
update-alternatives allows you to have multiple versions of something (java included) installed simultaneously, and to be able to switch between them as you wish.
Your output says you have both Java 7 and Java 8 installed, and currently your machine is configured to use Java 8.
You can remove the openjdk 1.7 packages if you want, but is probably unnecessary unless you have some special reason.
You you want to test how your update-alternatives looks with Java 7 enabled, you can use the “-config” option as follows (and switch back to Java 8 afterwards if you wish)