1

I am using external jar file in project, but I don't have any idea how to add doc for same project in Eclipse.

I followed TIPS but it's same, nothing reflect on use of Content assist(Ctrl-Space).

Any suggestion?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
CoDe
  • 11,056
  • 14
  • 90
  • 197
  • Expand your project directory in Project Explorer. Go to Java Resources, go to Libraries and locate your jar file that you imported. Right click that jar file and click Properties -> Javadoc Location -> Locate your javadoc jar file! – A M Apr 09 '14 at 07:01
  • This SO answer should help: http://stackoverflow.com/questions/9289617/eclipse-how-to-link-a-jar-containing-javadocs-source-with-its-binary – Dylan Apr 09 '14 at 07:02

4 Answers4

2

To add an external library to a project, right click the project and select

Build Path | Configure Build Path...

Hit the button:

Add External JARs...

and select the archive of your choice. Now click the small triangle, which is to the left of the archive, and select:

Javadoc location

Hit the button:

Edit...

and select once again the archive containing the JavaDoc. You may and should do the same for:

Source attachment

If you add the source archive, eclipse will generate the Javadoc on the fly for you. Hence, adding the Javadoc location is kind of obsolete. If you like to read the rendered Javadoc like in a browser, open the Javadoc View by selecting:

Windows | Show View | Javadoc

or pressing:

Alt + Shift + Q, J
Harmlezz
  • 7,972
  • 27
  • 35
0

Goto

Windows/Preferences

This will open a window for you. In left menu goto:

Java/Build Path/User Libraries

There on the right hand side, locate new button and create a new User Library. You can then see the Add Jars button will be enabled. You can add your jar file into your library then.

To include library into your project. Right click on your project and goto Build Path -> Add Libraries option. Add your library and use it in your project.

Udit Narayan
  • 109
  • 1
  • 7
0

If jar is loaded properly so the java docs will. In order to load jar copy that into your project. In eclipse explorer right click on jar and select--> Build Path --> Add to Build Path and its done. Or it is better to use some build tool like maven to import external jars.

Anurag Tripathi
  • 1,208
  • 1
  • 12
  • 31
0

Have you configured the Preferences of Content assist through Preferences » Java » Editor » Content Assist » Advanced in Eclipse?

prstk
  • 14
  • 3
  • Do you find the classes of the external jar listed under the Libraries of the project?Is the Content assist not working only for this external jar? – prstk Apr 09 '14 at 08:14
  • Yes, source classes are coming. Only content assist not working even after add it. – CoDe Apr 09 '14 at 08:27
  • If the Content assist is not working totally in eclipse,there might be misconfiguration in eclipse.Have you looked into http://www.mkyong.com/java/content-assist-ctrl-space-is-not-working-eclipse/ ? – prstk Apr 09 '14 at 09:30
  • No dear, it's not. for rest of class/API it's working as usual. – CoDe Apr 10 '14 at 05:56