This happens automatically if you configured the JDK, not the JRE.
Usually, when you start eclipse, it installs the JRE that was used to start eclipse. Usually you want to override this with the JDK to get the source. For this:
- First make sure you have JDK installed (not just JRE)
- Run eclipse
- Go to window-> Settings-> Java-> Installed JRE
- Click Add ...
- Select "Standard Virtual Machine" and click "Next ..."
- Click "Directory ...", select the JDK installation directory and click "Ok"
- Click Finish
- , JDK
- "Ok",
.