Java 在解决构建路径错误之前无法构建项目 eclipse

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

Project cannot be built until build path errors are resolved eclipse

javaeclipse

提问by Liondancer

I am trying to build a Java project. This used to be a breeze for me but ever since I changed my workspace to another location to store my new projects, I've been running into trouble. I get these two errors.

我正在尝试构建一个 Java 项目。这曾经对我来说轻而易举,但是自从我将工作区更改为另一个位置来存储我的新项目后,我就遇到了麻烦。我收到这两个错误。

Description Resource    Path    Location    Type
The project cannot be built until build path errors are resolved    InterviewPractice       Unknown Java Problem
Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project 'InterviewPractice'   InterviewPractice       Build path  Build Path Problem

I've looked up fixes online but none of them seem to be working for me.

我在网上查找了修复程序,但似乎没有一个对我有用。

While building the project, selecting the JRE selection. I'm also not sure what to choose. I think default it was set to OSGi/minimum 1.0but I'm honestly not sure what that does. I simply want to build simple programs for interview practice. So JavaSE-1.7?

在构建项目时,选择 JRE 选项。我也不知道该选择什么。我认为默认设置为,OSGi/minimum 1.0但老实说,我不确定它的作用。我只是想为面试练习构建简单的程序。那么JavaSE-1.7

when I click JRE system library a popup that says An error has occurred. See error log for more details. java.lang.NullPointerException

当我单击 JRE 系统库时,会弹出一个显示发生错误的窗口。有关更多详细信息,请参阅错误日志。java.lang.NullPointerException

采纳答案by hurricane

I think it is about your jre version. Did you try jre6 ?

我认为这与您的 jre 版本有关。你试过 jre6 吗?

Package Explorer >> Right Click >> Build Patch >> Configure Build Path >> Libraries >>

包资源管理器>>右键单击>>构建补丁>>配置构建路径>>库>>

Delete Your JRE .

删除您的 JRE。

Then Add Library >> JRE System Library >> Environments >> Select JRE6 >> Finish

然后添加库>> JRE系统库>>环境>>选择JRE6>>完成