If your using eclipse and maven, burried somewhere in eclipse is a
check box and it will attempt to automatically download source for any
jar dependency your project has. The same is true for javadoc.
If your managing your eclipse project manually or with another tool
then it's a manual process.
You might try here
https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.hamcrest%22%20AND%20a%3A%22hamcrest-core%22
IntelliJ also has this feature and I'm sure Netbeans does too.
If manual, find the jar in the dependency section, then right click
and you can associate with javadoc or source code. Then when debugging
and stepping thought code or following source code it will show you
the source code instead of a decompiled version.
Not used eclipse for ~4 years but used it for 5 years before then so
it might have changed slightly but the option is avaliable.