dangling symlink: /usr/lib/jvm/java-*-openjdk-amd64/src.zip

Bug #1723417 reported by Laurent Bonnaud
36
This bug affects 16 people
Affects Status Importance Assigned to Milestone
openjdk-11 (Ubuntu)
Confirmed
Undecided
Unassigned
openjdk-17 (Ubuntu)
Confirmed
Undecided
Unassigned
openjdk-8 (Ubuntu)
Confirmed
Undecided
Unassigned
openjdk-lts (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hi,

this is a dangling symlink:

lrwxrwxrwx 1 root root 20 sept. 30 02:37 /usr/lib/jvm/java-8-openjdk-amd64/src.zip -> ../openjdk-8/src.zip

when the openjdk-8-source package is not installed. The symlink should probably be moved to this other package.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: openjdk-8-jdk-headless 8u144-b01-2
Uname: Linux 4.13.6-041306-generic x86_64
ApportVersion: 2.20.7-0ubuntu3
Architecture: amd64
CurrentDesktop: KDE
Date: Fri Oct 13 14:18:22 2017
EcryptfsInUse: Yes
SourcePackage: openjdk-8
UpgradeStatus: Upgraded to artful on 2017-09-29 (14 days ago)

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :
Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

The same bug exists in OpenJDK-11 in disco:

$ ls -l /usr/lib/jvm/java-11-openjdk-amd64/src.zip
lrwxrwxrwx 1 root root 21 04-02 16:42 /usr/lib/jvm/java-11-openjdk-amd64/src.zip -> ../openjdk-11/src.zip

tags: added: disco
summary: - dangling symlink: /usr/lib/jvm/java-8-openjdk-amd64/src.zip
+ dangling symlink: /usr/lib/jvm/java-*-openjdk-amd64/src.zip
Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

A similar bug still exists in hirsute:

$ ls -l /usr/lib/jvm/openjdk-11/src.zip
lrwxrwxrwx 1 root root 11 Mar 18 10:05 /usr/lib/jvm/openjdk-11/src.zip -> lib/src.zip

tags: added: eoan focal groovy hirsute
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in openjdk-8 (Ubuntu):
status: New → Confirmed
Changed in openjdk-lts (Ubuntu):
status: New → Confirmed
Revision history for this message
sokai (sokai) wrote :

+1

Please move the link creation step to the "openjdk-8-source" package.
On my machine no "openjdk-8-source" is installed but the link is present ...

Here is some terminal explanation.

----- 8< -----
me@my-machine:~# ls -lha /usr/lib/jvm/java-8-openjdk-amd64/src.zip
lrwxrwxrwx 1 root root 20 Nov 3 14:54 /usr/lib/jvm/java-8-openjdk-amd64/src.zip -> ../openjdk-8/src.zip
me@my-machine:~# ls -lha /usr/lib/jvm/java-8-openjdk-amd64/../openjdk-8/src.zip
ls: cannot access '/usr/lib/jvm/java-8-openjdk-amd64/../openjdk-8/src.zip': No such file or directory
me@my-machine:~# aptitude search openjdk-8
p openjdk-8-dbg - Java runtime based on OpenJDK (debugging symbols)
p openjdk-8-dbg:i386 - Java runtime based on OpenJDK (debugging symbols)
p openjdk-8-demo - Java runtime based on OpenJDK (demos and examples)
p openjdk-8-demo:i386 - Java runtime based on OpenJDK (demos and examples)
p openjdk-8-doc - OpenJDK Development Kit (JDK) documentation
p openjdk-8-jdk - OpenJDK Development Kit (JDK)
p openjdk-8-jdk:i386 - OpenJDK Development Kit (JDK)
i openjdk-8-jdk-headless - OpenJDK Development Kit (JDK) (headless)
p openjdk-8-jdk-headless:i386 - OpenJDK Development Kit (JDK) (headless)
p openjdk-8-jre - OpenJDK Java runtime, using Hotspot JIT
p openjdk-8-jre:i386 - OpenJDK Java runtime, using Hotspot JIT
i openjdk-8-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
p openjdk-8-jre-headless:i386 - OpenJDK Java runtime, using Hotspot JIT (headless)
p openjdk-8-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
p openjdk-8-jre-zero:i386 - Alternative JVM for OpenJDK, using Zero/Shark
p openjdk-8-source - OpenJDK Development Kit (JDK) source files
----- 8< -----

Thanks for fixing and KR!

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

The bug still exists in lunar:

$ symlinks /usr/lib/jvm/openjdk-17/
dangling: /usr/lib/jvm/openjdk-17/src.zip -> lib/src.zip

tags: added: jammy kinetic lunar
removed: artful disco eoan focal groovy hirsute
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

The src.zip is a source package of the Java API classes. As it was pointed out in a comment above, the "src.zip" symbolic link created by the -jdk and-jdk-headless packages links to a .zip file which is actually installed by the corresponding -source package.

This kind of a dependency between packages is best represented by the "Suggests" relationship. It neither fits into the definition of "Depends", nor into the definition of "Recommends". See [1].

--------------------START OF TERMINAL OUTPUT ---------------------------------
$apt-rdepends -s Suggests openjdk-8-jdk | head -4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openjdk-8-jdk
  Suggests: openjdk-8-demo
  Suggests: openjdk-8-source
  Suggests: visualvm

$ apt-rdepends -s Suggests openjdk-17-jdk | head -4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openjdk-17-jdk
  Suggests: openjdk-17-demo
  Suggests: openjdk-17-source
  Suggests: visualvm

---------------------END OF TERMINAL OUTPUT --------------------------

Given the -jdk packages "Suggest" the corresponding -source packages, using apt's '--install-suggests' option is one of the ways to avoid this dangling symbolic link (possibly at the cost of having many unnecessary packages installed).

[1] https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control

tags: added: foundations-todo
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

However, after realizing that the -source packages "Depend" on the -jdk packages, the suggestion in comment #6 starts sounding good to me.

------------ START OF TERMINAL OUTPUT ---------------------
$ apt-rdepends openjdk-8-source | head -4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openjdk-8-source
  Depends: openjdk-8-jdk (>= 8u372-ga~us1-0ubuntu1~23.04)
  Depends: openjdk-8-jre (>= 8u372-ga~us1-0ubuntu1~23.04)

------------ END OF TERMINAL OUTPUT ----------------------

Changed in openjdk-11 (Ubuntu):
status: New → Confirmed
Changed in openjdk-17 (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

moving that to the source package means, that you have these symlinks for *all* architectures in the source package. Is this really worth it?

Changed in openjdk-11 (Ubuntu):
status: Confirmed → In Progress
Changed in openjdk-lts (Ubuntu):
status: Confirmed → New
Changed in openjdk-11 (Ubuntu):
status: In Progress → New
status: New → Confirmed
Changed in openjdk-lts (Ubuntu):
status: New → Confirmed
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

An implementation based on File triggers is feasible, but it might be perceived as an overkill given this problem is not actually a functional bug.

Vladimir Petko (vpa1977)
tags: added: reviewed
Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote :

The bug is still there in Ubuntu 23.10/mantic:

$ symlinks /usr/lib/jvm/openjdk-17/
dangling: /usr/lib/jvm/openjdk-17/src.zip -> lib/src.zip

tags: added: mantic
Revision history for this message
Thorsten Glaser (mirabilos) wrote :

openjdk-8-source is in Suggests for openjdk-8-jdk-headless, so the dangling symlink is not an actual bug.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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