ubuntu openjdk-7 the link "src.zip” is broken

installing openjdk8 again worked for me in ubuntu 16.04

step1: sudo apt install openjdk-8-source

step2 : attach the source.zip under(Window->preferences-java->Installed JREs->edit java-8-open-Jdk->expand rt.jar->click on Source attachment and attach the src.zip under /usr/lib/jvm/java-8-openjdk-amd64).


You should do:

sudo apt-get install openjdk-7-source

then the source code will be downloaded under: "/usr/lib/jvm/openjdk-7". The symlink:

src.zip -> ../openjdk-7/src.zip

should work now.


The answer from Alex is correct, as in how it should be. However, for OpenJDK 11 on Ubuntu 18.10 it appears that src.zip has been moved to lib/src.zip so the symlink cannot be resolved.

In addition to the

sudo apt install openjdk-11-source

command, run

echo "(cd /usr/lib/jvm/openjdk-11/; ln -s lib/src.zip)" | sudo bash

to create an additional symbolic link.


I downloaded sources from http://jdk7src.sourceforge.net/ and added them to eclilpse. It works fine now.