openjdk-8-jdk-缺少src.zip?

时间:2020-10-13 17:20:50

标签: java java-8

以下是必填信息-

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]

要查询已安装的二进制文件,我在下面尝试过-

$ 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

在查看jvm/java-8-openjdk-amd64目录时,我发现src.zip的链接已损坏

$ 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

现在我该如何获取资源,我想我可以手动获取它们-这是我唯一留下的选择吗?

1 个答案:

答案 0 :(得分:1)

假设您正在运行Ubuntu(Debian也是一样),则openjdk-8的源位于软件包openjdk-8-source中。

如果您查看软件包的filelist,则会发现:

/usr/lib/jvm/openjdk-8/src.zip

可以使用通常的方式安装软件包:

sudo apt-get install openjdk-8-source