Reputation: 389
I have recently installed a full Oracle jdk(not just jre) to my laptop, in /usr/lib/jvm/java-8-oracle/bin/java is its executable, yet when I type
sudo update-alternatives --config java
, I cannot see it, I see only Oracle jre. Why and how to fix it?
sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 auto mode
1 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
* 2 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode
3 /usr/lib/jvm/java-9-openjdk-amd64/bin/java 1091 manual mode
Press <enter> to keep the current choice[*], or type selection number: 0
update-alternatives: using /usr/lib/jvm/java-9-openjdk-amd64/bin/java to provide /usr/bin/java (java) in auto mode
Upvotes: 1
Views: 490
Reputation: 6324
You need to install it with sudo update-alternatives --install
see this answer for details.
Upvotes: 2