eclipse 在名为 Android Dependencies 的文件夹中添加 *.jar 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14523838/
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
Add *.jar file in folder named Android Dependencies
提问by Hayk Nahapetyan
I want to use library from openCV named
"opencv library -2.4.3"
, I install all what it needs , and now openCV tutorials work. So I need add the same openCV library to my project for use.
QUESTION
How to add opencv "library -2.4.3"
from another project to mine's folder named Android Dependencies
我想使用来自 openCV 的名为 的库
"opencv library -2.4.3"
,我安装了它需要的所有东西,现在 openCV 教程有效。所以我需要将相同的 openCV 库添加到我的项目中以供使用。问题如何将opencv"library -2.4.3"
从另一个项目添加到我的名为Android Dependencies
Thanks in advance
提前致谢
回答by Givi
Create a libs folder (/libs) in your project's root folder. Copy the wanted jar to it.
在项目的根文件夹中创建一个 libs 文件夹 (/libs)。将想要的 jar 复制到它。
It will be added to Android dependencies.
它将被添加到 Android 依赖项中。
回答by Leandros
You have to click on on the project properties (Right Click -> Properties) and add it as dependency there.
您必须单击项目属性(右键单击 -> 属性)并将其添加为依赖项。
回答by Pete OK
I just did this with a project, using eclipse 4.2.1. As with the other answerer, all I had to do was create a folder called "libs/"
in my project, and it auto-updated the Android Dependencies list. Are you copying and pasting inside of eclipse?
我只是在一个项目中使用 eclipse 4.2.1 完成了此操作。与其他回答者一样,我所要做的就是"libs/"
在我的项目中创建一个文件夹,它会自动更新 Android 依赖项列表。你是在 eclipse 里面复制和粘贴吗?
I moved the file to that folder using the file system, outside of eclipse.
我使用 eclipse 之外的文件系统将文件移动到该文件夹。
This link describes how the libs
folder gets added to Android Dependencies
:
此链接描述了libs
文件夹如何添加到Android Dependencies
:
http://tools.android.com/recent/dealingwithdependenciesinandroidprojects
http://tools.android.com/recent/dealingwithdependenciesinandroidprojects
回答by live-love
- Right click on project
- Select Properties
- Click on Android on left menu
- Click on Add
- Please select a Library Project
- 右键单击项目
- 选择属性
- 单击左侧菜单中的 Android
- 点击添加
- 请选择一个图书馆项目
The jar will go into Android Dependencies.
该 jar 将进入 Android 依赖项。
If you add the jar directly to your project under libs or using build path, then it goes under Android Private Libraries.
如果您将 jar 直接添加到 libs 下的项目或使用构建路径,则它位于 Android Private Libraries 下。
Both methods works but referencing a library project can have benefits if you want to alter the code of the library during development.
这两种方法都有效,但如果您想在开发过程中更改库的代码,引用库项目可能会有好处。