shyiko / jabba

(cross-platform) Java Version Manager
2.97k stars 193 forks source link

wrong java for GUI apps (jabba vs. update-alternatives) #768

Open tony-- opened 3 years ago

tony-- commented 3 years ago

I have adopt@1.11.0-9 installed and set as default, current and in .jabbarc:

~$ jabba ls
1.6.45-custom
adopt@1.11.0-9
adopt@1.8.202-08
~$ jabba alias default
adopt@1.11.0-9
~$ jabba current
adopt@1.11.0-9
~$ cat ~/.jabbarc 
adopt@1.11.0-9

Despite the above, before and after a reboot, when I try to launch eclipse, it complains about needing a Java 11 runtime because it is being launched with Java 8. I'm trying to figure out why, so I checked update-alternatives:

~$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                             Priority   Status
------------------------------------------------------------
  0            /home/tony/.jabba/jdk/adopt@1.8.202-08/bin/java   20000     auto mode
  1            /home/tony/.jabba/jdk/adopt@1.8.202-08/bin/java   20000     manual mode
* 2            /usr/lib/jvm/java-11-openjdk-amd64/bin/java       1111      manual mode

I switched to the system-installed java-11-openjdk-amd64 to workaround the problem for now, but why aren't the other jabba-managed java versions showing up? I want to use adopt@1.11.0-9 for all defaults, including non-interactive shell such as launching a java GUI app such as eclipse.

tony-- commented 3 years ago

Did I somehow break my system configuration for jabba without realizing it?