you need to have the jdk installed. then you can look in
for me it is
c:\program files\java\jdk1.6.0_11\ (depends on your current version)
you don't need to get a special open source version.
you can use 'eclipse class decompiler integrates jd, jad,' from eclipse marketplace.
from the find box in the eclipse marketplace write: 'jad' and you would find it.
src.zip file is present in installed jdk folder :
provide this path on the screen showing attach source... worked for me.
we can see c:\program files\java\jdk1.8.0_73\src.zip where c:\program files is a home directory where i have installed the java.
in eclipse, it will show like source not found. form there link will come like browse source. browse the link c:\program files\java\jdk1.8.0_73\src.zip and attach it. now you can see your source code.
@jjnguy suggestion worked for me. but make sure you have also changed the default compiler as well. right clickon th project-->java compiler->click on the link under jdk compliance(right section).
outside eclipse you can see the jdk sources on javasourcecode.org. on this page you can switch from the oficial api documentation to the source code and viceversa.
if you can't find the actual source you can also use a decompiler to regenerate source from the class file.
personally i use jad combined with the jadclipse plugin to view source in eclipse.
right click on the project -> build path -> configure build path. now edit your jre > select 2nd option alternate jre -> select any jdk (not jre). finish, now open any class by ctrl + click, its source code will display.
for ubuntu, install openjdk-6-source and use /usr/lib/jvm/java-6-openjdk/src.zip
you can go to http://openjdk.java.net/ and download the latest builds of the openjdk project. i think this should give you what you need.
you should be able to see "jre system library [jdk1.x.xxxx]" when you look at your project's java build path.
you can access the project build path configuration screen by: right clicking on the project -> build path -> configure build path... you should be able to see the jre system library entry at the bottom of the list.
the easiest way to view the source for the class is to use the "open type" shortcut. the default for this shortcut is: ctrl + shift + t". the class you're looking for should appear as you type it's name.
there are a few good answers here on where to get the source. but a word of caution: i'd be wary about how you use it (if you're using it simply for reference). the api documentation is the only contract you should code against, and is what the developers will keep consistent/intact between releases. i wouldn't use the source find out implementation details and then code my applications with regard to those implementation details, as they may change between releases.
when you are coding in eclipse, press ctrl and click on any core java class name in your source. eclipse will now show a screen saying you don't have the sources installed. however, in this screen there is a link saying "attach source...". click that link and import the src.zip file from your jdk installation directory (src.zip). this should do the trick
- How do I view JRE's source code in Eclipse on linux (debian)
- How to view the source code of Java classes in Eclipse without ctrl+click?
- How to view a source code of Eclipse Java SDK examples
- How do I view JRE's source code in Eclipse?
- How to Create Flowchart from java source code in Eclipse
- How to view Java's byte code in eclipse IDE?
- How to get Eclipse Console to hyperlink text to source code files?
- How to build Eclipse JDT Core from source code via Git?
- How do I attach source code locations to plugins in my Eclipse RCP target platform?
- Java source code not shown in Eclipse debug view
- how to check php function source code using eclipse
- How to set up spring source code for debugging in eclipse
- How to get Zend Framework view helper code completion in Eclipse (Aptana Studio 3)?
- How to see source code of JavaFX SDK in eclipse kepler?
- how to import source code into Eclipse from a jar file?
- How can I convince Eclipse CDT that a macro is defined for source code editing and code completion?
- Eclipse does not show source code of maven dependencies in debug view
- How to add Google's Guava to eclipse so I can read the source code
- how to work with Eclipse Source Code in Eclipse itself
- How to find the source code of Wildfly in Eclipse debug
- How to import and compile Android FBReaderJ source code into Eclipse (Windows)?
- How to import android email source code into eclipse project?
- How to view a longer code revision history in Eclipse
- How do I step into JDK source code when debugging remotely in Eclipse
- How to debug Eclipse source code
- How can I setup eclipse to follow through to the source code of methods in imported maven dependencies?
- How can I get an Eclipse installation that includes source code of its plugins?
- how turn off speculative execution in hadoop source code in eclipse
- Java source code editor as an Eclipse view
- Where should I look at in Eclipse source code to figure out how Eclipse generate JUnit testing result?
More Query from same tag
- Rearranging different views/windows in eclipse
- OpenCV 3.0.0 java.lang.UnsatisfiedLinkError in Eclipse
- using loops to print images/patterns in java
- Ant is not working in Eclipse Indigo Service Release 2
- Eclipse C++ MinGW - Can not Lauch Program <Terminated>
- removing line numbers for copied code in eclipse
- Add titled marker in eclipse
- How do I change all font sizes in Eclipse?
- no source attachement for javax.persistence
- EditText -Cannot invoke getText() on the primitive type int
- Convert WebSphere to Liferay project
- Getting "No Repository Found" error in Eclipse (Ganymede) while trying to install google plugins (GWT)
- Eclipse: svn:externals in cross-platform Phonegap folder structure?
- Calculating change in a program - Floating point error
- How to get a list of all possible exceptions that could happen within a specific scope
- R.java never appears
- Eclipse Swing designer
- Android - Image button (XML) isn't working?
- How to reinstall the appcompatv7_11 package in android?
- Scala imports compiler errors
- Eclipse Android exceptions are hidden
- Unable to create Hbase table from windows eclipse
- Apk file not getting generated
- Why eclipse always occur an error "An internal error occurred during: "Notifying selection listeners". java.lang.StackOverflowError"
- Any good IDE for Ruby on windows?
- Maven Build Asks for log file and (Permission Denied)
- Pre-fill new functions in Eclipse and Pydev with docstring and "Not Implemented" exception
- Configuring Eclipse for the OA Framework?
- In an eclipse plugin: How can I programmatically highlight lines of codes in the java editor?
- Specifiy JRE Container with gradle eclipse plugin