Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

WithoutBook Forum

Ques. How to attach javadoc or sources to jars in libs folder?

- I have a reusable application which I want to use in different apps.
Now I am making .jar file for that and need to add javadoc for that .jar file.
But in eclipse how can I see those java docs and for that what need to be done?

Posted on Jul 16, 2014 by Raj Mohan
Ans. For Eclipse follow the below:

Place the library .jar file in the libs folder, and the associated source .jar and doc .jar files in separate subfolders such as libs/src and libs/docs. You can use a name other than src and docs if you want, but it's important that the .jar files aren't directly in the libs folder.
Create a .properties file in the libs folder with the exact name of the actual library .jar (see example). Make sure you keep the .jar part.
Specify the relative paths to the sources and javadoc .jar in the .properties file.
Close and re-open the Eclipse project! Optionally, refresh the project by right click and clik on Refresh.
Select an object of the linked library in the source code.
Open the Javadoc view in Eclipse to check the documentation (see screenshot).
Open the source code declaration (default shortcut: F3) of the selected object.
Posted on Jul 16, 2014 by Raj Mohan

Enter your Answer

Name
Email Address
Answer
©2024 WithoutBook