posted 12 years ago
You never mentioned Eclipse in your original question, so how was I supposed to know? This makes your question one about Eclipse, so I am moving your post.
If you are using m2eclipse, and you have a Maven project, m2eclipse automatically downloads and attaches source JAR files. (Check you project's Build Path, under the Libraries tab expand Maven Dependecnies and then look under each JAR, many of them should have Source Attachment entries - see the attached image.) Of course, the source JARs must be available in the repository for this to work automatically. If there is no source JAR, you can always select Source Attachment, click the Edit button, and then browse to the source location (which you will have to provide yourself).
sourcesjars.png