英文:
openjdk-8-jdk - missing src.zip?
问题
以下是所需信息 -
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
现在我怎么获取这些源代码,我认为我可以手动获取 - 这是我唯一剩下的选择吗?
英文:
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??
答案1
得分: 5
假设您正在运行Ubuntu(Debian也相同),openjdk-8
的源代码位于openjdk-8-source
包中。
如果您查看该包的filelist,您会找到:
/usr/lib/jvm/openjdk-8/src.zip
您可以按照通常的方式安装该包:
sudo apt-get install openjdk-8-source
英文:
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
答案2
得分: 2
如果您在CentOS上,则使用:
sudo yum install java-1.8.0-openjdk-src
英文:
if you are in centos, then use
sudo yum install java-1.8.0-openjdk-src
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论