简体   繁体   English

如何导入Java项目(Eclipse)

[英]How to import java project (Eclipse)

I have tried importing a .zip project through eclipse by right clicking the project and selecting import, then navigating to the zip folder on my desktop and there we go. 我试图通过eclipse导入.zip项目,方法是右键单击该项目并选择import,然后导航到桌面上的zip文件夹,然后就可以了。 If i do this, i get a red exclamation mark next to the project name, which after googling i found was because of an error with the build path. 如果这样做,项目名称旁边会出现一个红色的感叹号,在谷歌搜索后发现这是由于构建路径错误所致。

The .zip was created from my bosses machine and emailed to me, however he is not in the office today and i am only a placement student so i have pretty much no idea how to fix this. .zip是从我的上司机器创建的,并通过电子邮件发送给我,但是他今天不在办公室,我只是一名实习生,所以我几乎不知道如何解决此问题。

Does anyone have any tips/ help they can provide me. 有没有人可以给我任何提示/帮助。 Thanks 谢谢

The import was correct. 导入是正确的。 Fixing build path errors is a common task after importing projects. 导入项目后,修复构建路径错误是一项常见任务。

You'll have to look at the build path settings for this project and have to find out, which libraries are missing and dependencies are unresolved. 您将不得不查看该项目的构建路径设置,并找出哪些库丢失并且依赖项尚未解决。

Right-click on the project name, --> Build Path --> Configure Build Path... 右键单击项目名称,->构建路径->配置构建路径...

Check Projects and Libraries Tab, the reason for the red exclamation mark is in there. 检查“ 项目库”选项卡,其中出现红色感叹号的原因。


You have to get rid of the build path errors, otherwise eclipse can't build the project. 您必须摆脱构建路径错误,否则eclipse无法构建项目。 Either provide valid paths for all libraries or delete classpath entries. 为所有库提供有效路径或删除类路径条目。

The should remove that exclamation mark and eclipse can build the project. 应该删除该惊叹号和蚀能建立项目。 But removing classpath entries most likely results in compile errors or runtime errors, if the application can't find external configuration files or so. 但是,如果应用程序找不到外部配置文件,那么删除类路径条目很可能会导致编译错误或运行时错误。

In your special case: Looks like the project depends on other projects (we see that quite often in eclipse) and it could be, that your boss did not give you all projects or your eclipse is not setup correctly (maybe your workspace should contain some default projects with default libraries). 在您的特殊情况下:看起来该项目依赖于其他项目(我们经常在eclipse中看到),并且可能是您的老板没有给您所有项目,或者您的eclipse设置不正确(也许您的工作区应该包含一些项目)具有默认库的默认项目)。 Ask co-workers, they may give a hint on that. 向同事询问,他们可能对此有所提示。

Go to 'configure build path' > android > select a target which will be available there. 转到“配置构建路径”> android>选择一个在那里可用的目标。 if this doesn't work then copy the 'lib' folder of any other project and paste it in your project. 如果这不起作用,则复制任何其他项目的'lib'文件夹并将其粘贴到您的项目中。 this will work together with target selected. 这将与所选目标一起使用。

Right click on your project, then select "build path", then "configure build path". 右键单击您的项目,然后选择“构建路径”,然后选择“配置构建路径”。 There will probably be errors in "libraries" tab. “库”选项卡中可能会出现错误。 Examine them and try to fix them. 检查它们并尝试修复它们。 For example, your boss might have a different JRE (Java Runtime Environment) path than you do. 例如,您的老板可能具有与您不同的JRE(Java运行时环境)路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM