Eclipse:构建期间发生错误。运行构建器“Java Builder”时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46595727/
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
Eclipse: Errors occurred during the build. Errors running builder 'Java Builder'
提问by E?rendil Baggins
I'm having an error while trying to make Eclipse Oxygen work in Kubuntu 16.04. Whenever I open a file, and sometimes on Eclipse startup too even if there's no open ones, I get many errors, in particular some I can't copy that occur when I try to use code completion, and most of all this one:
我在尝试使 Eclipse Oxygen 在 Kubuntu 16.04 中工作时出错。每当我打开一个文件时,有时在 Eclipse 启动时,即使没有打开的文件,我也会遇到很多错误,尤其是当我尝试使用代码完成时,我无法复制一些错误,其中最重要的是:
Errors occurred during the build.
Errors running builder 'Java Builder' on project 'MyFirstAfterReinstallAndPlugin'.
java.lang.NullPointerException
I have to specify that this started to occur after I downloaded the extension for Java 9 support and created a new project with the Java_SE9 JRE: before that it would behave in another strange way. Code correction wouldn't find the "System" class and a lot of strange errors happened. I have installed openjdk9 and javac from command line works fine. Plus Eclipse said that I had to have Java 1.8 or superior, making the fact that it didn't work before strange as well.
我必须指出这是在我下载 Java 9 支持扩展并使用 Java_SE9 JRE 创建新项目后开始发生的:在此之前它会以另一种奇怪的方式运行。代码更正找不到“系统”类,发生了很多奇怪的错误。我已经从命令行安装了 openjdk9 和 javac 工作正常。加上 Eclipse 说我必须有 Java 1.8 或更高版本,这使得它之前不起作用的事实也很奇怪。
I've tried everything I found online but still can't figure this out.
我已经尝试了我在网上找到的所有内容,但仍然无法解决这个问题。
回答by paulsm4
Look here:
看这里:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=498755
Thanks for the report. This has been fixed recently. You may want to try a recent build from http://download.eclipse.org/eclipse/downloads/
This bug has been marked as a duplicate of bug 496675
https://bugs.eclipse.org/bugs/show_bug.cgi?id=498755
谢谢你的报告。最近已修复此问题。您可能想从http://download.eclipse.org/eclipse/downloads/尝试最近的构建
此错误已标记为错误 496675 的副本
SUGGESTIONS:
建议:
Try the latest/greatest update to Eclipse Oxygen
... OR ...
If that doesn't work, try an OLDER version (e.g. Neon, or even Mars2)
尝试最新/最伟大的 Eclipse Oxygen 更新
... 或者 ...
如果这不起作用,请尝试使用旧版本(例如 Neon,甚至 Mars2)
回答by Naman
Eclipse Oxygen.1a (4.7.1a) Release
Eclipse Oxygen.1a (4.7.1a) 发布
Update as of 11 October,2017- You can upgrade to the latest eclipse packageEclipse Oxygen.1a (4.7.1a) which is now released and supports Java 9.
2017年10 月 11 日更新- 您可以升级到最新的Eclipse 包Eclipse Oxygen.1a (4.7.1a),该包现已发布并支持 Java 9。
回答by user8946474
I was also getting the following error. To fix this I changed the Build class path order so that the JRE was listed last. (Project Properties>Java Build Path>Order and Export)
Errors running builder 'Java Builder'
java.lang.NullPointerException on project X
我也收到以下错误。为了解决这个问题,我更改了 Build 类路径顺序,以便最后列出 JRE。(项目属性>Java 构建路径>订购和导出)
Errors running builder 'Java Builder'
java.lang.NullPointerException on project X
回答by satish sidnakoppa
*solved
*解决了
I faced same issue Recent code change had caused the compilation issue and this compilation was not shown in eclipse as the java file has 7K lines and build was failing.
我遇到了同样的问题最近的代码更改导致了编译问题,并且此编译未在 Eclipse 中显示,因为 java 文件有 7K 行并且构建失败。
I moved the methods to new file. Then compilation errors were shown by eclipse.
我将方法移至新文件。然后eclipse显示编译错误。
I fixed the code and build was successful.
我修复了代码并且构建成功。
回答by Wiitry
I solved this problem simply by deleting the project causing the trouble, and then re-importing it in Eclipse.
我只是通过删除引起问题的项目,然后在 Eclipse 中重新导入它来解决这个问题。
Delete the project from the Eclipse workspace.
(i) Simply 'remove' the project: not delete its files !!PROCESS:
- Right-clic on the project to delete.
- Context-menu :>Delete
- DO NOT 'Delete project contents on disk' !!
Then, reimport the project.
PROCESS:
- menu :>File/>Import
- />Existing Project into Workspace
- ...
从 Eclipse 工作区中删除项目。
(i) 只需“删除”项目:不要删除其文件!!过程:
- 右键单击要删除的项目。
- 上下文菜单:>删除
- 不要“删除磁盘上的项目内容”!!
然后,重新导入项目。
过程:
- 菜单:>文件/>导入
- />现有项目到工作区
- ...