jks-keystore hook fails with "java: not found" during package install

Bug #1953121 reported by Tomáš Virtus
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ca-certificates-java (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

This is a fresh report of https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/1406483 with same steps to reproduce. Currently it can be reproduced in both impish and jammy.

ca-certificates-java installs /etc/ca-certificates/update.d/jks-keystore that's being run as part of package installation. The hook is run before update-alternatives installs /usr/bin/java. The script modifies its own PATH by looking for known JRE (or JDK) installs in /usr/lib/jvm. However, the list of known JREs is hardcoded and outdated. When ca-certificatges-java is installed as a dependency of openjdk-17-jre-headless, no known JRE is found, and PATH is unchanged, so there's no java in PATH when this is first JRE being installed on the system.

The fix in linked bug synced from Debian just adds paths of newer JREs to check. Currently paths up to Java 11 are checked. This issue will keep resurfacing unless ca-certificates-java is kept up to date with latest JRE in archives, or the search for JRE is changed.

Steps to reproduce in official Docker jammy image (where no JRE is installed):
$ sudo docker run ubuntu:impish bash -c 'apt-get update && apt-get install -y openjdk-17-jre-headless'

Tags: jammy impish
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ca-certificates-java (Ubuntu):
status: New → Confirmed
Revision history for this message
Vladimir Petko (vpa1977) wrote :

Impish is EOL, the issue for jammy is being addressed in LP: #1998065

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.