eclipse doesn't pull the tooltips from the javadoc location. it only uses the javadoc location to prepend to the link if you say open in browser, you need to download and attach the source for the jdk in order to get the tooltips. for all the jars under the jre you should have the following for the javadoc location: http://java.sun.com/javase/6/docs/api/. for resources.jar, rt.jar, jsse.jar, jce.jar and charsets.jar you should attach the source available here.
ensure "preferences" -> "java" -> "editor" -> "hovers" -> "combined hover" is checked.
i just had to dig through this issue myself and succeeded. contrary to what others have offered as solutions, the path to my happy ending was directly correlated to javadoc. no "src.zip" files necessary. my trials and tribulations in the process involved finding the correct javadoc to point at. pointing a java 1.7 project at java 8 javadoc does not work. (even if "jre8" appears to be the only installed jre available.) thus, i beat my head against the brick wall unnecessarily.
window > preferences > java > installed jres
if the jre of your project is not listed (as happened to me when i migrated a jre7 project to a new jre8 workspace), you will need to add it here. click "add..." and point your workspace at the desired jre folder. (mine was c://program files/java/jre7). then "edit..." the now-available jre, select the rt.jar, and click "javadoc location..." and aim it at the correct javadoc location. for my use:
voila, hover tooltip javadoc is re-enabled. i hope this helps anyone else trying to figure this problem out.
if you are using maven:
mvn eclipse:eclipse -ddownloadsources=true -ddownloadjavadocs=true
likely a problem with the path that you specified in javadoc location. it is pretty finicky. make sure that it points at the root of where the javadoc starts. it could be a few directories down in the zip you've downloaded.
i have had a similar issue and looks like that the culprit was the space in the path to the archive (e.g., c:\program files\java\jdk). after moving the archive to another directory without spaces in path it started to work.
choose one class you want to view its documentation and press ctrl+click over it, the javadoc page will inform you that there is no javadoc file attached and bellow will see a button named "attach file". press that button and browse to the directory where jdk is installed, normally for win is c:\program files\java\jdk_xxx and inside this folder there is a src.zip file - sleect it and press ok and all is done - you already have javadoc attached.
for openjdk 8 on linux see: https://askubuntu.com/questions/755853/how-to-install-jdk-sources
the way that worked for me is:
- the default
src.zipis a symbolic link pointing to a non-existing folder ...
sudo apt-get install openjdk-8-sourcethis adds this folder
window --> preferences --> java --> "installed jres", edit and point to
src.zip(or open any jre class like for example hashmap and attach source)
you should now see the javadoc when opening jre classes via ctrl+shift+t, previously this was not possible, eclipse may have got a docs from the default url on mouse over methods but this requires a stable internet connection.
go to your jdk installation. (
c:\program files\java\jdk1.8.0_66for me).
c:\program files\java\jdk1.8.0_66\src\for me).
in the eclipse editor window:
ctrl + clickon a
java.langlibrary class. (something like
eclipse will complain
source not foundand tell you that you don't have the source.
find your source folder (
c:\program files\java\jdk1.8.0_66\src\for me).
i went through the same problem and i did not find some of the above answer useful because they are old and with new jdk 1.8 , documentation section has been moved to src.zip in jdk folder (c:\program files\java\jdk1.8.0_101 ) .
now i tried everything from above and it was showing me the same problem if i press ctrl and click on (for example string or system) in my program i get the source not found.
now you can do this, go to the folder where jdk (c:\program files\java\jdk1.8.0_101) is installed and try to unzip src.zip. here you might face an issue as sometime due to administrative rights on this folder it would not allow you to unzip this src.zip. for solving the issue , copy src.zip and paste in any other folder ( example desktop) and then create a folder src and unzip in it. now copy this folder back to jdk 1.8 folder**(c:\program files\java\jdk1.8.0_101).**
now just go to eclipse and open any program and press ctrl and click on any external objects or anything (for example string or system) .you will get source not found , now click attach source -> external location -> external folder and add your src location (c:\program files\java\jdk1.8.0_101\src). now you are good to go , i tried and it worked for me.
all the above folder location are from my system , so it might be different for you.
old question, but i had current problems with this issue. so i provide you my solution. now the sources and javadocs are inside the jdk. so, unzip your jdk version.you can see that contanins a "src.zip" file. here are your needed sources and doc files. follow the path: window->preferences->java->installed jres-> select your jre/jrd and press "edit" select all .jar files, and press source attachement. select the "external file..." button, and point it to src.zip file.
maibe a restart to eclipse is needed. (normally not) now you should see the docs, and also the sources for the classes from jdk.
for offline javadoc from zip file rather than extracting it.
why this approach?
this is already answered which uses extracted zip data but it consumes more memory than simple zip file.
comparison of zip file and extracted data.
jdk-6u25-fcs-bin-b04-apidocs.zip ---> ~57 mb
after extracting this zip file ---> ~264 mb !
so this approach saves my approx. 200 mb.
how to use apidocs.zip?
windows -> preferences
installed jresthen click
jre system librariesthen click
archive pathand set
path within archiveas shown above. that's it.
5.put cursor on any class name or method name and hit shift + f2
to use offline java api documentation in eclipse, you need to download it first. the link for java docs are (last updated on 2013-10-21):
- extract the zip file in your local directory.
- from eclipse
window --> preferences --> java --> "installed jres"select available jre (jre6: c:\program files (x86)\java\jre6 for instance) and click edit.
- select all the "jre system libraries" using control+a.
- click "javadoc location"
- change "javadoc location path:" from "http://download.oracle.com/javase/6/docs/api/" to "file:/e:/java/docs/api/".
it must work as it works for me. i don't need internet connection to view java api documentation in eclipse anymore.
- How do I add the Java API documentation to Eclipse?
- How to get the Android API documentation in Eclipse
- How do I add a shortcut key to Eclipse 3.2 Java plug-in to build the current project?
- How do I set the Java Doc for google drive api for android in Eclipse
- How do I add the Java 7 JRE to Eclipse on my mac?
- How to add the android-async-http.JAR in Eclipse Java Build Path
- How to find the methods in Java API in Eclipse
- Eclipse RCP: How to add a new element to a default Java dropdown menu in the toolbar(New Java Class)
- How to add Spark Java API (Javadoc) in eclipse
- how to add the JDBC API in eclipse IDE
- how do I add classpath to the exported runnable java .jar file using eclipse
- How to properly add name of the location text file in eclipse in java into Scanner file reader
- How to add Subclipse plugin to the newer version of eclipse Java EE IDE??
- How to turn off the Eclipse code formatter for certain sections of Java code?
- How do I import the javax.servlet / jakarta.servlet API in my Eclipse project?
- How to enable the Java keyword assert in Eclipse program-wise?
- How do I add a resources folder to my Java project in Eclipse
- How to add shortcut keys for java code in eclipse
- How to create the pom.xml for a Java project with Eclipse
- How can I set the current line of execution in the eclipse java debugger?
- How do I display a byte array as an array of hex bytes or unsigned decimal numbers in the Eclipse Java debugger?
- How to add Java EE perspective to Eclipse
- How to know the command line used by Eclipse to run the java program?
- How do I add existing eclipse java project to git
- How to add Tomcat 8 to Eclipse Kepler without installing the big whole WTP package
- How can I use the java Eclipse Abstract Syntax Tree in a project outside Eclipse? (ie not an eclipse plugin)
- How to add a Java Properties file to my Java Project in Eclipse
- How do I add a directory to the eclipse classpath?
- Eclipse - how to give the Java Console unlimited length (in # lines)
- how to add an xml file to the java application's classpath in eclipse?
More Query from same tag
- Not able to debug C program in eclipse which has scanf() statements
- How to open Java perspective in Eclipse mars for php?
- Eclipse IDE crashes on Windows 10 before setting up workspace
- Clamav open source antivirus
- The constructor MainActivity.MyPagerAdapter1(MainActivity, List<Fragment>) is undefined
- Use TBB with OpenCV and Python (Eclipse)
- Eclipse Breakpoint and get Environment Variables
- Adding ArrayList Objects to GridView in Android
- Checkstyle Eclipse plugin doesn't work
- Writing inline assembly in a separate .S file
- Why might Eclipse failing to identify fields?
- java.lang.NoClassDefFoundError when using MongoDB driver
- Building a Java project which does not have javadoc.exe
- Cofoja : error: error in contract: package com.google.java.contract does not exist
- In Subclipse, is there a quicker way to commit changes to SVN?
- Executing a simple mapreduce function for searching a string in a log file in Hadoop
- Glassfish on Eclipse. An error occurred while collecting items to be installed
- cvc-complex-type.2.4.a invalid content was found starting with element factory in faces-config.xml
- Constructor and object declaration specific matter
- Opening source code from debug view edits .class after Android R18 update
- how can i write image in resources folder in spring mvc project
- eclipse broken since java 6.31: Cannot find the class file for java.lang.Enum
- Debug Sconscript file eclipse
- Setting (dp) values in properties box in Eclipse
- How can i change eclipse code completion settings?
- How to fix Subclipse if I can't share my project anymore?
- How do I change a Java project's bin folder in Eclipse?
- Eclipse doesn't see the project in the run configuration
- Creating a 4 + 1 Architecture model
- Eclipse quicktip wont show "import" suggestions in Linux Ubuntu and Centos