Below is the required info –
apt list | grep installed | grep -i openjdk-8-jdk WARNING: apt does not have a stable CLI interface. Use with caution in scripts. openjdk-8-jdk-headless/focal-security,focal-security,now 8u265-b01-0ubuntu2~20.04 amd64 [installed,automatic] openjdk-8-jdk/focal-security,focal-security,now 8u265-b01-0ubuntu2~20.04 amd64 [installed]
To query the installed binaries, i tried below –
$ dpkg -L openjdk-8-jdk /. /usr /usr/lib /usr/lib/jvm /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/java-8-openjdk-amd64/bin /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer /usr/lib/jvm/java-8-openjdk-amd64/bin/jconsole /usr/lib/jvm/java-8-openjdk-amd64/include /usr/lib/jvm/java-8-openjdk-amd64/include/jawt.h /usr/lib/jvm/java-8-openjdk-amd64/include/linux /usr/lib/jvm/java-8-openjdk-amd64/include/linux/jawt_md.h /usr/lib/jvm/java-8-openjdk-amd64/lib /usr/lib/jvm/java-8-openjdk-amd64/lib/jconsole.jar /usr/lib/jvm/java-8-openjdk-amd64/man /usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8 /usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8/man1 /usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8/man1/appletviewer.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8/man1/jconsole.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/man1 /usr/lib/jvm/java-8-openjdk-amd64/man/man1/appletviewer.1.gz /usr/lib/jvm/java-8-openjdk-amd64/man/man1/jconsole.1.gz /usr/share /usr/share/doc /usr/share/doc/openjdk-8-jre-headless /usr/share/doc/openjdk-8-jre-headless/test-amd64 /usr/share/doc/openjdk-8-jre-headless/test-amd64/check-hotspot-hotspot.log.gz /usr/share/doc/openjdk-8-jre-headless/test-amd64/check-jdk-hotspot.log.gz /usr/share/doc/openjdk-8-jre-headless/test-amd64/check-langtools-hotspot.log.gz /usr/share/doc/openjdk-8-jre-headless/test-amd64/failed_tests-hotspot.tar.gz /usr/share/doc/openjdk-8-jre-headless/test-amd64/jtreg-summary-hotspot.log.gz /usr/share/doc/openjdk-8-jre-headless/test-amd64/jtreport-hotspot.tar.gz /usr/share/doc/openjdk-8-jdk
On looking in to the jvm/java-8-openjdk-amd64
directory, I see the link for src.zip
is broken
$ ll total 28 drwxr-xr-x 7 root root 4096 Sep 6 20:44 ./ drwxr-xr-x 3 root root 4096 Sep 6 20:43 ../ lrwxrwxrwx 1 root root 22 Aug 3 06:46 ASSEMBLY_EXCEPTION -> jre/ASSEMBLY_EXCEPTION drwxr-xr-x 2 root root 4096 Sep 6 20:44 bin/ lrwxrwxrwx 1 root root 41 Aug 3 06:46 docs -> ../../../share/doc/openjdk-8-jre-headless/ drwxr-xr-x 3 root root 4096 Sep 6 20:44 include/ drwxr-xr-x 5 root root 4096 Sep 6 20:43 jre/ drwxr-xr-x 3 root root 4096 Sep 6 20:44 lib/ drwxr-xr-x 4 root root 4096 Sep 6 20:43 man/ lrwxrwxrwx 1 root root 20 Aug 3 06:46 src.zip -> ../openjdk-8/src.zip //this is in red i.e. broken lrwxrwxrwx 1 root root 22 Aug 3 06:46 THIRD_PARTY_README -> jre/THIRD_PARTY_README
Now how do i get the sources, i think i can get them manually – is this the only option I am left with??
Advertisement
Answer
assuming you are running Ubuntu (it’s the same for Debian), sources for openjdk-8
are in the package openjdk-8-source
.
if you look at the filelist of the package, you will find:
/usr/lib/jvm/openjdk-8/src.zip
the package can be installed in the usual way:
sudo apt-get install openjdk-8-source