Iewicz
Iewicz

Reputation: 193

How to attach source code to Support Library in Eclipse

I read all posts that answer this question but they all are old and didn't work for me. Is there any way to just attach source code to the Support Library (v4, v7, app_compat..) in Eclipse and avoid seeing the message "This element neither has attached source nor attached Javadoc and hence no Javadoc could be found. note"?

Somebody told me there is no way to do it since it is closed source, is that true? Since there is nothing under the library's source folder.

Thanks.

Upvotes: 0

Views: 869

Answers (2)

Rban
Rban

Reputation: 24

Here is what solved the problem for me. My project depends on appcompat_v7 library, which (I think) provides the android-support-v4.jar file to the project. I created android-support-v4.jar.properties file exactly as guided in How can I enable javadoc for the Android support library?. Added that file to lib folder in appcompat_v7 rather than project's lib folder.enter image description here

Upvotes: 1

krossovochkin
krossovochkin

Reputation: 12122

Try this one:

1) Download jar file containing the JavaDocs.
2) Open the Build Path page of the project (right click, properties, Java build path). 3) Open the Libraries tab.
4) Expand the node of the library in question (JavaFX). 5) Select JavaDoc location and click edit.
6) Enter the location to the file which contains the Javadoc (the one you just downloaded).

Hope this helps.

Source: How to attach source or JavaDoc in eclipse for any jar file e.g. JavaFX?

UPDATE: If you don't have javadocs itself, you can generate them by yourself:

cd <path_to_android_sdk>/extras/android/compatibility/v4/
mkdir docs
javadoc -d docs -sourcepath src\java -subpackages android.support.v4

Source: How to install javadoc for Android Compatibility Package?

Upvotes: 0

Related Questions