2

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"

5 Answers5

3

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
2

Eclipse doesn't provide this functionality, I believe.

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

We're All Mad Here
  • 1,544
  • 3
  • 18
  • 46
  • What i dont understand is why i cannot have an android project be treated like a standard project, i was under the impression that the project type was defined by its contents... For that matter, could i not just manually create an android project to include the external libs? – Konner Rasmussen Dec 31 '13 at 18:39
2

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

petey
  • 16,914
  • 6
  • 65
  • 97
  • i understand that fact, i want to have all the libs automatically included in the "Android 4.2.2" folder, and not have to manually add them. can i not simply edit the file that this represents to include the JARs every time it gets used? – Konner Rasmussen Dec 31 '13 at 18:43
1

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.

Peter
  • 1,769
  • 1
  • 14
  • 18
1

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