I have a class ABC.class with a method doStart(). This method has some documention which explains the functionality of the method. Now I have this class inside a jar file , say myProject.jar. I have myProject.jar in my classpath and I am using the doStart() method in another java file ( say myClient.java). Now I have the myClient.java open in my Eclipse and I want to see the user must see the documentation for the doStart() method while he hover the mose point in the .doStart() . ( like for any Java standard API we get the help). I hope the question is clear. Please let me know .
Thanks Seetharaman. I am aware of that step which you mentioned. Unfortunately I do not want to do that.I would prefer the jar file to be given to different application so that they can use the function.
thanks Luke. But I have a question. I open the rt.jar which comes with jdk. I did not see any javadoc folder in it. How I am able to see the documention for methods or constants? for instance, if I hover my mouse over System.out.println, I can see the explanation for each. I am aware that it is coming from the java doc part. But the question is where is it in the rt.jar?
The JavaDoc for the standard API is special. On my one system it is pulling from the the internet (http://java.sun.com/javase/6/docs/api/) and for another it found the local copy I had of the JavaDocs installed under my JRE. You can set those values using Window\Preferences\Java\Installed JREs. Select the JRE you want to set the JavaDocs for and press Edit. Select the JAR file(s) and press the JavaDoc Location and set it either to a local (file://) or web (http://) url, or to an Archive.
For other sources of JavaDocs the docs have to found in the folder as described above.
Thanks Luke.. That works. But everytime if I give my jar file to different folks, then they need to do this excerise ? I mean unzio the my jar file, get the javadoc folder and place it in their local machine and then edit the Javadoc location as you mentioned in your reply? There must be some alternative so that the user do not have to do it manually.
1) Since you are shipping code, and worried about how it works in Eclipse, then ship your code as an Eclipse project, preconfigured with the JavaDocs setup.
2) Package the JavaDocs in the JAR, in a directory like MyJar!/docs/. This may work, not sure. When the user adds the JAR to the workspace using Project\Properties\Java Build Path\Libraries - Add External JAR the JAR you add has a tree-expansion node. Expand the tree and there is a JavaDoc location. Select it, press edit, choose the JavaDoc In Archive option and navigate to the same JAR, and for the Path within Archive choose the /docs/ directory you put the JavaDocs into. Yes the user probably has to do this themselves. And while they are at it, you might want to instruct them to set the source attachment at the same time since you are providing them the source code.