如何在 Eclipse 的类路径中放置一个 jar? [英] How to put a jar in classpath in Eclipse?
问题描述
我是类路径和 Ant 中的 n00b.在阅读 GCM for Android 教程时,我遇到了一条线
Hi I am n00b in classpath and Ant. While reading the tutorial of GCM for Android I came across a line
步骤 1:将 gcm.jar 文件复制到您的应用程序类路径
要编写您的 Android 应用程序,首先从以下位置复制 gcm.jar 文件SDK 的 gcm-client/dist 目录到您的应用程序类路径.
To write your Android application, first copy the gcm.jar file from the SDK's gcm-client/dist directory to your application classpath.
我从 dist
文件夹中得到了 gcm.jar.现在我如何使用 Eclipse 将它放入我的类路径中(我认为这会更容易)?如果我没有 Eclipse,我会在哪里进行更改?
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?
感谢
推荐答案
从 Android Developer Tools rev 17 开始,在使用工具和 Eclipse 时添加库 jar 的正确方法是创建一个名为 libs
与您的 src
和 assets
目录位于同一级别,然后将 jar 放入其中.不需要其他任何东西,工具会自动为您处理所有其他工作.
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.
这篇关于如何在 Eclipse 的类路径中放置一个 jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!