Question

I have figured out how to obtain the effect i desire on the desktop.

(Window > Preferences > Java > Installed JREs > jre7 [Edit] > [Add External JARs])

but i cant get the same effect on android.

In the desktop project i can see the folder "JRE Sysytem Library(jre7)" contains all the JARs i referenced

This directory is not present in the android project. How do I add libraries to be automatically included in an Android project without needing to use the "R-Click Project > Properties > Java Build Path > Libraries" method OR the "R-Click JAR file > Build Path > Add to build path" method in the IDE "Eclipse"

Was it helpful?

Solution

In the desktop project i can see the folder "JRE Sysytem Library(jre7)" contains all the JARs i referenced

An Android app does not use the JRE.

How do I add libraries to be automatically included in an Android project without needing to use the "R-Click Project > Properties > Java Build Path > Libraries" method OR the "R-Click JAR file > Build Path > Add to build path" method in the IDE "Eclipse"

That is not possible, sorry. Android does not use Eclipse's "Add External JARs" regardless of whether it is manually or automatically populated. It only uses JARs in libs/ or attached Android library projects.

OTHER TIPS

Eclipse doesn't provide this functionality, I believe.

You can on the other hand Select configure build path and just add the libraries.

Put the jars in the "libs" folder in your android project root folder. They will be used and exported from the build system (ant/gradle).

This link will help let you know what each folder in an android project could be used for here:

http://developer.android.com/tools/projects/index.html#ApplicationProjects

Another way would be to setup an Android Library Project which includes common dependencies of your projects, so you could add this library project as dependency in the Project->Properties->Android - Section.

Since nobody gave me an answer to my question (although they all of you did provide useful info and i think you for that) I will post the solution i found (but have not yet implemented)

I am using libgdx to create my applications so after looking and searching for a way to have eclipse automatically include libs when generating an android project, i realized that the answer was obvious (but not easy to do)...

i downloaded the libgdx source from github, learned how to use command line git and ant, and followed their instructions to get the source running. i now have the setup ui project working out of source. and am beginning my day by trying to get the libs i use included in the setup...

i know its possible and will edit this post with information on if/how i managed to accomplish this lofty goal

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top