find_java_runtime finds only latest java, even if others are installed

Bug #1795911 reported by Thomas Schweikle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
java-wrappers (Ubuntu)
New
Undecided
Unassigned

Bug Description

function find_java_runtime will only find latest java installed, regardless of other java versions available.

find_java_runtime java11 -> echo $JAVA_CMD -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
find_java_runtime java10 -> echo $JAVA_CMD -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
find_java_runtime java9 -> echo $JAVA_CMD -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
find_java_runtime java8 -> echo $JAVA_CMD -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
find_java_runtime java7 -> echo $JAVA_CMD -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java

but:
# ll /usr/lib/jvm
total 72K
drwxr-xr-x 6 root root 4.0K Oct 3 03:01 ./
drwxr-xr-x 292 root root 44K Oct 3 13:10 ../
drwxr-xr-x 4 root root 4.0K Oct 2 06:07 java-1.5.0-gcj-4.8-amd64/
drwxr-xr-x 4 root root 4.0K Oct 2 06:07 java-1.5.0-gcj-5-amd64/
drwxr-xr-x 7 root root 4.0K Oct 2 06:35 java-7-openjdk-amd64/
drwxr-xr-x 7 root root 4.0K Oct 2 06:35 java-8-openjdk-amd64/
drwxr-xr-x 7 root root 4.0K Oct 2 06:35 java-9-openjdk-amd64/
drwxr-xr-x 7 root root 4.0K Oct 2 06:35 java-10-openjdk-amd64/
drwxr-xr-x 9 root root 4.0K Oct 2 06:36 java-11-openjdk-amd64/
lrwxrwxrwx 1 root root 25 Apr 8 15:16 default-java -> java-1.11.0-openjdk-amd64/
lrwxrwxrwx 1 root root 20 Jul 21 2016 java-1.7.0-openjdk-amd64 -> java-7-openjdk-amd64/
lrwxrwxrwx 1 root root 20 Jul 21 2016 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64/
lrwxrwxrwx 1 root root 20 Jul 21 2016 java-1.9.0-openjdk-amd64 -> java-9-openjdk-amd64/
lrwxrwxrwx 1 root root 20 Jul 21 2016 java-1.10.0-openjdk-amd64 -> java-10-openjdk-amd64/
lrwxrwxrwx 1 root root 21 Aug 24 19:36 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64/

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: java-wrappers 0.3
ProcVersionSignature: Ubuntu 4.15.0-36.39-generic 4.15.18
Uname: Linux 4.15.0-36-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
CurrentDesktop: XFCE
Date: Wed Oct 3 16:37:57 2018
Dependencies:
 gcc-8-base 8.2.0-1ubuntu2~18.04
 libbz2-1.0 1.0.6-8.1
 libc6 2.27-3ubuntu1
 libgcc1 1:8.2.0-1ubuntu2~18.04
 unzip 6.0-21ubuntu1
InstallationDate: Installed on 2011-10-19 (2540 days ago)
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
PackageArchitecture: all
SourcePackage: java-wrappers
UpgradeStatus: Upgraded to bionic on 2018-10-02 (1 days ago)

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Thomas Schweikle (tps) wrote :

Actually I did:
unset JAVA_CMD; find_java_runtime java8; echo $JAVA_CMD

Revision history for this message
Thomas Schweikle (tps) wrote :

because once set JAVA_CMD will be used regardless what java you'll want!

Revision history for this message
Thomas Schweikle (tps) wrote :

Solved with a later version. Behaves now as described.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.