Eclipse Helios not showing Javadoc - java

I have recently got a new computer and I have put Eclipse Helios on there. Before, on my old computer, when I used the control-assist (Ctrl + Space) and highlighted the suggested methods, the Javadoc for that method used to appear at the side of the control assist pop up window with the method description and parameters etc...
However, on my new computer this Javadoc doesn't appear and only the method suggestions appear - but even the arguments for the methods aren't named (they're just called arg0, arg1 and so on). The only thing I can think of that is different on the new install is ZoneAlarm but as far as I can see I have allowed eclipse through the firewall; unless it's something to do with Java itself.
This feature is really useful to me so any advice on how to resolve this issue would be greatly appreciated. Thanks in advance.

Eclipse is using a JRE instead of a JDK as the default Java.
Download and install a JDK.
In Eclipse Preferences, Java -> Installed JRE's. Use "Add" or "Search" to locate and add the JDK just installed.
Move the check mark indicating the default Java to the newly found JDK.
Allow the workspace to rebuild.

You need to press F3 on the Class or Method name you want to see javadoc for. Then in the editor it's source will open or if you don't have source attached, you'll have screen with bytecode saying that no sources attached. Then you need to open package view, by default it's on the left side. On the top of it there is an icon with two arrows, if it's not pressed, press it. It will show source you've opened in the package view, then you need to find jar file containing your source by scrolling up if you already don't stand on it.
Now press right mouse button on that jar, you'll see properties window. Select javadoc, then you need to select location of the javadoc. You can provide a URL to an online javadoc. The URL you will be pointing to must provide a page named 'index.html' or similar or Eclipse won't allow you to use that URL. Also you can download javadoc locally and then select the location of that javadoc archive. If you need the javadoc for java SE libraries, you can find it in your jdk installation directory in src.zip folder. Hope it'll help.

Did you specify the javadoc location of your library?
Window -> Preferences -> Java -> Installed JREs -> Select your JRE -> Edit -> Select .jar file(s) (rt.jar) -> Javadoc Location

Related

is there java packages need to be added in netbeans IDE explicitly? [duplicate]

I have some problems with Netbeans IDE. I installed v. 7.0.1, but now the pop-up windows of the javadoc say:
Javadoc not found. Either Javadoc documentation for this item does not exist or
you have not added specified Javadoc in the Java Platform Manager or the Library
Manager.
Why didn't it auto-download the JavaDocs? I'm talking about component, method etc etc.. of Java Platform SE.
Go to Tools -> Java Platforms
Select the platform that you want and go to the javadoc tab
and the url to the javadocs. either http://docs.oracle.com/javase/6/docs/api/ or http://docs.oracle.com/javase/7/docs/api/
I believe JDK include javadoc in it But something went wrong either at the time of installation or later. So I solved this issue using these steps:
Goto
Tools >> Analyze Javadoc
An Analyzer tab will appear with the method/s that you defined and have no javadoc.
Select its checkbox and Fix Selected Button will enable press that button and problem is now gone.
In my case removeAllRows() is the method that has no javadoc.
For further check this image
.
It does not create missing javadoc for your own methods But also fix javadoc for predefined methods.
If this does not solve your problem than you should try adding javadoc manually.

How to configure IntelliJ for Mac to show Java and Android documentation within the editor (offline, not online)?

How do I configure IntelliJ to access offline documentation (for both Java and Android if possible) without leaving my IDE? I'm using IntelliJ IDEA 13.1. My Android application is building and running fine so my installation seems to be correct. I've examined the relevant SO posts:
How to view JDK external documentation in IntelliJ IDEA?
JDK documentation in IntelliJ IDEA on Mac OS X)
IntelliJ and the android java docs
But either the paths they recommend are not on my machine (the posts are rather dated) or else too vague. Interestingly my /Library/Java/JavaVirtualMachines folder seems to be empty whether I use Finder or Terminal. My Documentation paths tab under the File | Project Structure menu item is empty.
I should add that I'm attempting to use the Shift+F1 keyboard command when I have a keyword highlighted. That's what is recommended, but nothing happens. Below are pics of my current documentation paths in the Project Structure dialog. All done according to recommendations as far as I can see, but maybe someone can spot something.
I think configuring the path to src.zip should be enough, IntelliJ will retrieve the Javadoc from the source files. In Modules Settings, in the SDKs panel choose your current SDK, go to the Sourcepath tab and make sure there's an entry for src.zip.
On OSX it's located under
/Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/src.zip
or
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/src.zip
depending on which SDK you have and how you installed it.
For the Android doc, I guess you can do the same if they provide a zip containing all the source files.
Command + ; open Project Structure
on left panel select SDKs
in Sourcepath tab click +, select your src.zip

Is there any way to access java swing help from eclipse

is there any way to have Java Swing help/docs appear in Eclipse when floating over a Swing item. It would save a lot of time bringing up a Google search.
First download the corresponding docs for your jre, I have 7 so I would get this one. (You can alternatively use the online method but this way is faster and you can use it offline)
Open Eclipse and go to Window > Preferences > Java > Installed JREs. You can then select the jre you are using and click edit.
Select all the .jar items from JRE system libraries then click Javadoc Location..., Tick Javadoc in archive and then locate the .zip you downloaded, set it to Archive path and set the Path within archive textbox to docs/api.
You can then check to see if this is set up properly by clicking Validate. It should print a similar message like the one above. (Location is likely valid..)
Hover over a keyword and it should popup the docs, you can press F2 to 'focus' on the information. You can also use Shift + F2 to open it in a new tab.

Source code navigation and JavaDoc bug in Eclipse Indigo

I have a problem with Eclipse Indigo regarding library source code. When I open a library class (e.g. from the JDK, but also from some other included libraries, such as Guava), either using the Open Type dialogue or simply through Ctrl+ click on the class name or some of its methods, once in a while (not always) something breaks.
Don't get me wrong, the source is always displayed without any problem (either JDK source shipped with the JDK itself or Guava source downloaded by Maven). What actually stops to work:
When I open the Quick Outline popup in that given class using Ctrl + O, the list of methods and fields displays normally, but when I click on any of them, Eclipse doesn't move the view on it as it should. Also Ctrl + clicking any of the methods or fields of that class in my code doesn't bring me directly to it, but simply at the top of the source file.
When I hover over that said class or its methods, no JavaDoc appears in the popup as you can see in the attached image. I am in the HashSet class, the source is clearly there, but it isn't displayed in the popup.
I found out that this can be fixed by opening the Outline View and briefly clicking through the class's methods and fields. After a few clicks, Eclipse catches on and starts to work correctly, but only for this one class, not for all which are broken in this way at the moment.
Has anybody met this kind of bug? Is it tracked at Eclipse Bugzilla? Thanks in advance for any advice.
For completeness, this is my configuration:
Windows 7 Professional x64
Oracle JDK 1.7 Update 2 32b
Eclipse Indigo for Java EE Developers 32b
your issue #2 may be resolved by following these steps :
Go to http://java.sun.com/j2se/1.5.0/download.jsp and choose to
download the JDK 5.0 Source Code.
For JDK 5.0, select Download(SCSL source).
Download JDK (SCSL) 5.0 (1.5.0). This will give you a file jdk-1_5_0-src.scsl.zip. You do not need to unzip this file; Eclipse likes it the way it is.
In Eclipse, go to Projects -> Properties -> Java Build Path -> Libraries and expand JRE System Library [jre 1.5.0], then rt.jar. Select Source attachment and click Edit...
Select the above zip file. and Finish by exiting the dialog boxes.
source
Hope this helps..
Sounds like wrong sources are attached to the libs inside Eclipse.
I had similar symptoms in a project where a class exist in both: inside a lib and in the project's src folder. Same canonical class name, but different implementations.
I would recommend to verify (or reinstall) your JDK-Installation and re-configurating it in Eclipse.
Hitting Ctrl+Shift+T and typing HashSet and taking a screenshot of that window may help here, too.
To answer my own question, I didn't find out how to solve the problem in Indigo, but updating to Juno fixed it.

how to add javaDoc to my Java code in a NetBeans based project?

How can I add JavaDoc or other document to netbeans ?
I try with this way :
Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip (in my desktop)
but in editor when I press Ctrl+Space in tooltiptext this message shown :
Javadoc not found. Either Javadoc documentation for this item does not exist or you have not added specified Javadoc in the Java Platform Manager or the Library Manager.
I tried restarting NetBeans but this was the result:
try this in NetBeans IDE
Choose Tools > Java Platform Manager from the main window.
Select the platform to which you want to add Javadoc in the left panel of the dialog box.
In the Javadoc tab, click Add ZIP/Folder and specify the location of the Javadoc files.
Click Close.
Hope this helps.
If you are using maven in your project then follow below steps to attach Java docs for your attached libraries.
Right click on "Dependencies" folder of your project.
Then choose "Download javadoc" option
It will download javadoc of your libraries and attached it.
Now when you will press ctl + space then you will see docs for that library.
and If you want to add javadoc for particular library then follow the options as suggested by Himanshu Soni.
You can't usually just add the javadoc zip as a separate library (at least this hasn't worked for me in the past.) In the libraries section you need to select the library you want to add the Javadoc for and then add the Javadoc jar for that specific library.
Restart Netbeans then that should work. Though of course if there really is no Javadoc for that method you still won't get any (I've fallen into that trap a couple of times before!)
You followed the very right procedure, I've been threw this right before I write this answer, and as for this is the first result that shows up when you Google the problem, I think that many people will find it handy and save their time, the solutions is:
UNZIP the JavaDoc.zip file that you are referring to ( which is supposed to be jdk-7u4-apidocs.zip for JavaSE 7 docs) and repeat the same procedure, which is Tools --> Java Platforms --> Javadoc ( tab ) then press " Add Zip/Folder, and point to the unzipped folder instead of the zipped one, restart NetBeans, and it will work smooth and direct.
You should download the docs file from the following link:
http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html
After completing the described operation, you will have your javadocs available offline, and you don't need to be connected to the internet to know about APIs.
Best regards brother.
"Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip"
The problem with above step can be solved easily by moving down following two path already added in content panel as shown below.
Step 1-
Goto: Tools >> Java Platform >> JavaDoc Tab
and Add ZIP/Folder you want to add.
Step 2-
Step 3-
That's all and if zip file doesn't works the extract first and then add it.
I had the same problem, and I solved it by removing all URLs and adding only the apidocs.zip downloaded from oracle. After that restart your NetBeans.
Before test whether it works be sure the method you are looking for actually exists within the apidocs. Open index.html and make a search for that particular package.class.method you need.
If it doesn't work, try to manually copy the apidoc.zip to the docs directory of netBeans:
C:\Program Files\NetBeans 7.1.2\java\docs and then retry.
this help me:
http://wiki.netbeans.org/FaqJavaDoc#Adding_the_JDK_Javadoc_to_the_NetBeans_IDE
try it, maybe help
Using a Maven project inside of Netbeans v8.02.
First, view your project via the Projects window;
Expand your project's Dependencies folder
Right-click the desired *.jar file
Click download javadoc
Done!
This worked for me, I manually copy the apidoc.zip to the docs directory of netBeans: C:\Program Files\NetBeans 7.1.2\java\docs and then restart my netbeans.

Categories

Resources