导入 org.eclipse 无法解析

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31650103/
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 22:45:21  来源:igfitidea点击:

The import org.eclipse cannot be resolved

javaeclipsejarimport

提问by BlackCat

I cloned a git java project with Eclipse, but I get many errors because I cant resolve these imports:

我用 Eclipse 克隆了一个 git java 项目,但是我得到了很多错误,因为我无法解决这些导入:

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

What should I do?

我该怎么办?

I use Eclipse IDE for Java Developers, Version: Mars Release (4.5.0).

我使用 Eclipse IDE for Java Developers,版本:Mars Release (4.5.0)。

Solution: The source was an eclipse plugin, and I needed JAVA EE Eclipse to compile and run it. Thanks for the help greg-449.

解决方法:源码是一个eclipse插件,需要JAVA EE Eclipse编译运行。感谢 greg-449 的帮助。

回答by greg-449

Eclipse IDE for Java Developers does not contain the Eclipse Plugin Development Environment needed to build and run this project.

Eclipse IDE for Java Developers 不包含构建和运行此项目所需的 Eclipse 插件开发环境。

You can install it using 'Help > Install New Software'. Work with the main site for your version of Eclipse (Mars in your case) and install 'Eclipse Plugin Development Environment'.

您可以使用“帮助 > 安装新软件”来安装它。使用您的 Eclipse 版本的主站点(在您的情况下为 Mars)并安装“Eclipse 插件开发环境”。

Note that the code you are trying to build is an Eclipse plugin and will only run as part of Eclipse.

请注意,您尝试构建的代码是一个 Eclipse 插件,并且只会作为 Eclipse 的一部分运行。