Installing Java SE Source Files and Linking to Eclipse on CentOS 5

?When I first set up a developoment VM with CentOS I must have forgotten to install the Java source because I could not navigate to Java SE method declarations in my Eclipse IDE.

To have access to the Java source I did the following:

  • yum install java-1.6.0-openjdk-src
  • A file was placed in:
  • /usr/lib/jvm/java-1.6.0-openjdk-

I created a src dir in the aforementioned containing dir and unpacked the zip
I then linked to the source from Eclipse by:
Right-clicking on some java.lang.* method in a class and selecting “view source”
Originally it presented me with a view of the .class file
Clicking on the Add Source button, I navigated to the /usr/lib/jvm/java-1.6.0-openjdk- dir

Leave a Reply