导入zip文件作为库 - Eclipse Java [英] Importing zip file as library - Eclipse Java

查看:205
本文介绍了导入zip文件作为库 - Eclipse Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里坚持导入google http库。我在以下链接中进行了一些研究:



然后我按照以下步骤操作:


  1. 防爆将所有google api内容拖到一个名为lib的文件夹中

  2. 创建新用户Librarby窗口 - >首选项 - > Java - >构建路径 - >新建 - >命名库 - >离开系统库未选中 - >添加外部jar - >手动添加所需的jar。

  3. 右键单击项目文件夹 - >构建路径 - >配置构建
    路径 - >库 - >添加库 - >用户库 - >检查创建的用户
    图书馆。

总而言之:不要将库作为zip导入,否则您将长时间头疼。



希望这有助于别人。



编辑:如果出现某些错误,像丢失属于用户库的文件,清洁项目可能被证明是一个解决方案。但是,刷新项目对我来说很好。尝试按F5或右键单击项目文件夹,然后选择刷新。


I stucked here importing google http library. I made some research in links such as:

  1. Eclipse, Java: How to import a library in zip-format?
  2. Import Libraries in Eclipse?

The thing is, I imported correctly and was working right. But after some point it stopped to work. I creater one user library, imported the zip file which contain the library but it's not sort of "compiling the library".

Take a look at the print, please:

I'm trying to solve on my own for four hours but I'm getting tired... could anyone help me please?

Edit One:

Edit Two:

解决方案

Did some more research and found this:

  1. How to add external library properly in Eclipse?

I then followed the steps:

  1. Extracted all google api content to one folder named lib
  2. Created a New User Librarby Window -> Preference -> Java -> Build Path -> New -> Name your library -> left the System Library unchecked -> Add External Jars -> manually added the needed jars.
  3. Right click on project folder -> Build Path -> Configure Build Path -> Libraries -> Add Library -> User Library -> checked the created user library.

In conclusion: Don't ever import the library as a zip or you will have a long headache.

Hope this helps someone else.

Edit: In case of some error showing up, like missing files belonging to the user library, cleaning the project may prove to be a solution. However, refreshing the project worked just fine for me. Try pressing F5 or right clicking on your project folder and select refresh.

这篇关于导入zip文件作为库 - Eclipse Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆