安装AspectJ Eclipse

问题描述 投票:1回答:1

我正在尝试着手进行面向方面的编程。我正在使用最新的日食(当前为12-2019)

public aspect Observer {

}

这会导致错误Syntax error on token "aspect", interface expected

根据https://www.eclipse.org/ajdt/downloads

我添加了http://download.eclipse.org/tools/ajdt/43/update

作为日食的更新站点

Eclipse AspectJ Install Site

但是,日食告诉我某些部件无法安装

Install Error

似乎缺少某些部分

无法完成安装,因为一个或多个必需项可能会找不到。正在安装的软件:AspectJ开发工具2.2.3.e43x-RELEASE-20130627-0800(org.eclipse.ajdt.feature.group 2.2.3.e43x-RELEASE-20130627-0800)缺少要求:AspectJ 1.7.3.20130613144500-a(org.aspectj.ajde 1.7。 3.20130613144500-a)要求'osgi.bundle; org.eclipse.core.runtime.compatibility 0.0.0'但找不到它不能满足依赖关系:来自:AspectJ编译器1.7.3.20130613144500-a(org.aspectj.feature.group 1.7.3.20130613144500-a)收件人:org.eclipse.equinox.p2.iu; org.aspectj.ajde [1.7.3.20130613144500-a,1.7.3.20130613144500-a]无法满足依赖关系:来自:AspectJ开发工具2.2.3.e43x-RELEASE-20130627-0800(org.eclipse.ajdt.feature.group 2.2.3.e43x-RELEASE-20130627-0800)收件人:org.eclipse.equinox.p2.iu; org.aspectj.feature.group [1.7.3.20130613144500-a,1.7.3.20130613144500-a]

我如何使Aspects在Eclipse中运行?您能帮我吗?

java eclipse aspectj
1个回答
0
投票

您的问题是由于从Eclipse 4.6中删除了org.eclipse.core.runtime.compatibility插件引起的。

阅读有关this problem here的更多信息。

正确的解决方案是:

从正确的AspectJ安装download link

最新到Eclipse 4.10的更新是:http://download.eclipse.org/tools/ajdt/410/dev/update

另一个解决方案是:

  1. 卸载Eclipse。

  2. 安装Eclipse 4.3(与您的AspectJ版本匹配)。

  3. 重试AspectJ安装。

更复杂的解决方案是:

  1. org.eclipse.core.runtime.compatibility查找并生成/提取Maven repository jar文件。

  2. org.eclipse.core.runtime.compatibility jar文件放入Eclipse插件目录。

  3. eclipse模式运行--clean以重建和注册添加的插件。

  4. 重试AspectJ安装。

您可能会遇到org.eclipse.core.runtime.compatibility缺少更多的依赖项,最终将不得不加载所有相关插件(需要很长时间)。

© www.soinside.com 2019 - 2024. All rights reserved.