How to include jar files in an eclipse project

I am new to android and java. I downloaded the GSON library for use in my Android project, which exists in Eclipse. I am looking for 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 the 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 in your project and select Add Library ... instead.

No need to place external JAR files in the resource folder ... Unquote

I am afraid that I do not know the difference between “using third-party banks in my project” and “including third-party banks with my package”. I want to be able to use GSON methods in my Android application and, of course, be able to deploy to my .apk.

So what do I want to do? Thanks Gary

+4
source share
3 answers
  • add the jar to your libs folder in your project.

  • open eclipse go to package explorer

  • right click on your project and select project properties

  • click on java. Create a path in the panel to the left of the popup

  • select the library tab

  • select "Add External Jar File" and browse to the JAR file

good luck good luck =)

+5
source

packageExplorer

Click Properties

Properties

left select Path string

Then add the jar and do not use external libraries unless it is really required.

You need to copy the jar into your project in order to find it using the "Add banks"

+4
source
  • Right click on your main project in Project Explorer

  • Open the properties parameter located at the bottom of the context menu

  • A dialog box will open from which you select the Android option

  • Delete the old .jar file, press ADD to add a new .jar file, and select your file that you want to add

  • You are done!

0
source

Source: https://habr.com/ru/post/1435595/


All Articles