How to put a jar in classpath in Eclipse?

vincent mathew picture vincent mathew · Jul 13, 2012 · Viewed 112.3k times · Source

Hi I am n00b in classpath and Ant. While reading the tutorial of GCM for Android I came across a line

Step 1: Copy the gcm.jar file into your application classpath

To write your Android application, first copy the gcm.jar file from the SDK's gcm-client/dist directory to your application classpath.

I got the gcm.jar from the dist folder. Now how do I put it into my classpath using Eclipse(I think that would be easier)? And where would I make changes if I didnt have Eclipse?

Thnaks

Answer

Barak picture Barak · Jul 13, 2012

As of rev 17 of the Android Developer Tools, the correct way to add a library jar when.using the tools and Eclipse is to create a directory called libs on the same level as your src and assets directories and then drop the jar in there. Nothing else.required, the tools take care of all the rest for you automatically.