1

this may sound like a noob question, but it is a big problem for me. I have a file called yandex-translator-java-api-master.zip, and I tried adding that as an external JAR to my eclipse project, but the code wouldn't work; It wouldn't let me import.

This error comes up when i try to import "Translate" Translate cannot be resolved 6 quick fixes available: Create class, create constant, fix proj. setup...etc, etc.

How do i use this??? Where is the .jar i am supposed to import?

4

2 回答 2

1

下载此文件: 在此处输入图像描述

并将其建立为图书馆。说明在这个答案中。

于 2015-09-17T20:11:20.090 回答
1

zip存档与jar. 首先,jar从 zip 存档中提取,然后将其添加为依赖项。然后你就可以导入了。

UPD:仔细观察,我想你是从 GitHub(或另一个 VCS)下载的存档,它只是一个库的来源。您不能将其添加为依赖项,但例如,您可以将此代码粘贴到项目的/src/main/. 这是一个简单的解决方案。如果您想以正确的方式进行操作,您可以 a) 搜索已编译的库 b) 从下载的源创建一个模块并将其添加为依赖项

于 2015-09-17T20:02:32.470 回答