如何使用 Eclipse 在 Android 应用程序中包含额外的 javax.* 包?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3902943/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:11:09  来源:igfitidea点击:

How to Include additional javax.* packages in Android App with Eclipse?

androideclipse

提问by mohamed sakr

I saw an article about including additional javax.* packages in your Android App http://code.google.com/p/dalvik/wiki/JavaxPackages.

我看到了一篇关于在您的 Android 应用程序中包含其他 javax.* 包的文章 http://code.google.com/p/dalvik/wiki/JavaxPackages

I wanted to do the same thing, but using Eclipse. Could anyone help me figure out how to do this?

我想做同样的事情,但使用 Eclipse。谁能帮我弄清楚如何做到这一点?

回答by Abhinava

Step 1: Properties -> Java Build Path -> Libraries -> add external jar

第一步:属性->Java Build Path->Libraries->添加外部jar

Step 2: Properties -> Java Build Path -> Order and Export -> check the new lib

第二步:属性 -> Java Build Path -> Order and Export -> 检查新的lib

回答by Hymannad

Adding an External Library (.jar) using Eclipse

使用 Eclipse 添加外部库 (.jar)

You can use a third party JAR in your application by adding it to your Eclipse project as follows:

您可以通过将第三方 JAR 添加到您的 Eclipse 项目中来在您的应用程序中使用它,如下所示:

  1. In the Package Explorer panel, right-click on your project and select Properties.

  2. Select Java Build Path, then the tab Libraries.

  3. Press the Add External JARs... button and select the JAR file.

  1. 在 Package Explorer 面板中,右键单击您的项目并选择 Properties。

  2. 选择 Java Build Path,然后选择选项卡 Libraries。

  3. 按 Add External JARs... 按钮并选择 JAR 文件。

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.

或者,如果您想在您的包中包含第三方 JAR,请在您的项目中为它们创建一个新目录,然后选择添加库...。没有必要将外部 JAR 放在资产文件夹中。