Dean Blakely
Dean Blakely

Reputation: 3595

how to include jar files in my eclipse project

I'm new to android and java. I downloaded the GSON library for use in my android project which exists in Eclipse. I lookup instructions on how to use the jar file in my project and it says... Quote... You can use a third party JAR in your application by adding it to your Eclipse project as follows:

In the Package Explorer panel, right-click on your project and select Properties.
Select Java Build Path, then the tab Libraries.
Press the Add External JARs... button and select the JAR file. 

Alternatively, if you want to include third party JARs with your package, create a new directory for them within your project and select Add Library... instead.

It is not necessary to put external JARs in the assets folder ...UnQuote

I'm afraid that I don't know the difference between "using a 3rd party jar in my project" and "include third party jars with my package." I want to be able to use the GSON methods in my Android phone application and, of course, have the capability deployed in my .apk.

So, Which do I want to do? Thanks, Gary

Upvotes: 5

Views: 13015

Answers (3)

Jolly Chauhan
Jolly Chauhan

Reputation: 1

  1. Right click onto your main project in the Project Explorer

  2. Open properties option, found at the bottom of the context menu

  3. A dialog box opens from which you select the Android option

  4. Remove the old .jar file, click on ADD to add a new .jar file and select your the file you want to add

  5. You're done!

Upvotes: 0

user529543
user529543

Reputation:

packageExplorer

click Properties

Properties

left select Build path

Than add jar, and do not use the external libs, unless it is really required.

You have to copy the jar to your project to find it with "Add jars"

Upvotes: 4

chris-tulip
chris-tulip

Reputation: 1830

  1. add the jar to your libs folder in your project.

  2. open eclipse go to package explorer

  3. right click on your project and select project properties

  4. click on java Build path in the bar on the left hand side of the popup

  5. select the libraries tab

  6. select the "Add External Jar File" and navigate to your JAR file

best of luck =)

Upvotes: 6

Related Questions