Eclipse 中未绑定的类路径容器
我已经使用 Subversive for Eclipse 检查了一个项目,并且收到以下错误:
- 解决构建路径错误之前无法构建项目
- 未绑定的类路径容器:'JRE System Library[jdk1.5.0_08]'
我假设第一个一旦出现第二个错误,错误就会得到解决。我想我需要安装 JDK 1.5.0_08 并将其设置为项目的 jre 系统库,但我找不到任何地方可以下载它 - 我能得到的最接近的是 JDK 1.5.0_22。
如果有人可以提供替代解决方案(或者我想是 jdk1.5.0_08 的下载链接),我将不胜感激。
I have checked out a project using Subversive for Eclipse and I am getting the following errors:
- The project cannot be built until build path errors are resolved
- Unbound classpath container: 'JRE System Library[jdk1.5.0_08]'
I'm assuming the first error will be resolved as soon as the second one is. I think I need to install JDK 1.5.0_08 and set it as a jre system library for the project but I can't find anywhere to download it - the closest I can get is JDK 1.5.0_22.
If anyone could provide an alternative solution (or a download link for jdk1.5.0_08 I suppose) I would appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(14)
当我重新创建工作区时,我遇到了类似的问题,该问题通过以下方式修复:
在 Eclipse 中,转到 Window -> 。首选项。在 Java 下,选择“Installed JRE”并选中其中一个框以指定默认 JRE。单击“确定”,然后返回到项目的属性。转到“Java Build Path”部分并选择“Libraries”选项卡。删除未绑定的系统默认库,然后单击“添加库”按钮。选择“JRE System Library”就可以了!
I had a similar problem when I recreated my workspace that was fixed in the following way:
In Eclipse, go to
Window -> Preferences
. Under Java select "Installed JREs" and check one of the boxes to specify a default JRE. Click OK and then go back to your project's properties. Go to the "Java Build Path" section and choose the "Libraries" tab. Remove the unbound System Default library, then click the "Add Library" button. Select "JRE System Library" and you should be good to go!鉴于常见问题解答,共享项目文件似乎具有优势,甚至是 Java 项目的推荐做法(就我个人而言,我不会这样做)。
也许以下一些工作适合您:
Given the FAQ, sharing a project file seems have to have advantages and is even recommended practice for Java projects (personally, I would not do that).
Maybe some of the following work for you:
要解决此问题:
To fix this:
这是一个很老的问题,我最近遇到了这个问题。答案还说确保您在 Eclipse 属性的 Installed JRE 部分中注册了正确的 JDK,仅此而已。我注册了正确的 JDK 并将其标记为默认值,但仍然收到此错误。还有一个缺失的部分。
确保“已安装的 JRE”部分中的目标运行时环境名称与导入的项目中提到的名称完全相同。例如,如果您收到的错误是 -
未绑定类路径容器:'JRE System Library [JavaSE-1.8]'
。然后,在 Installed JRE 中,您需要注册 JDK 1.8,并且其名称应该是方括号中提到的确切值,在本例中为JavaSE-1.8
。This is pretty old question and I recently came across this. Also answers says make sure that you have the correct JDK registered in Installed JRE section of Eclipse properties, and that is it. I had the correct JDK registered and that was marked as default, but still I got this error. There is one more missing piece.
Make sure the in the Installed JREs section the name of your target runtime environment is exactly as it is mentioned in your imported project. For example if the error you get is -
Unbound classpath container: 'JRE System Library [JavaSE-1.8]'
. Then in Installed JREs you need to have JDK 1.8 registered and its name should be the exact value mentioned in square brackets, which in this case isJavaSE-1.8
.事实上,这个问题要在“首选项”->“选项”下修复。 Java->安装的 JRE。
如果所需的 JRE 在列表中显而易见 - 只需选择它即可。
否则必须先将其安装在您的计算机上,以便您可以
通过“添加”-> 添加它标准虚拟机->目录,在弹出的浏览器窗口中选择其路径 - 类似“program files\Java\Jre#” -> “好的”。现在您可以从列表中选择它。
Indeed this problem is to be fixed under Preferences -> Java -> Installed JREs.
If the desired JRE is apparent in the list - just select it, and that's it.
Otherwise it has to be installed on your computer first so you could
add it with "Add" -> Standard VM -> Directory, in the pop-up browser window choose its path - something like "program files\Java\Jre#" -> "ok". And now you can select it from the list.
该错误应该会在 IDE 中消失。
the error should go away in IDE.
当你
对于每个配置错误的文件,会出现两个错误。
如果没有。有问题的项目很少:
,当您有很多项目时,摆脱此类问题的最佳方法是:
但是
或者
The problem happens when you
You get two errors for each misconfigured files.
If the no. of projects having problem is few:
But the best way to get rid of such problem when you have many projects is:
EITHER
OR
即使安装了 JDK 1.7 后我也遇到了同样的问题。我通过将 bin 目录添加到我的 PATH 中来纠正它。所以我去了
然后添加
然后我按照这些说明操作
http ://clean-clouds.com/2012/12/06/how-to-install-and-add-jre7-in-eclipse/
I had the same problem even after installing JDK 1.7. I corrected it by adding the bin directory to my PATH. So I went to
and then added
then I followed these instructions
http://clean-clouds.com/2012/12/06/how-to-install-and-add-jre7-in-eclipse/
在已配置的工作区中,它刚刚停止构建:
在使用最新更改更新共享项目后,我偶尔会发生这种情况。我不知道为什么,也许他们的 JRE 安装路径与我的略有不同。
In an already configured workspace where it just stopped building:
This occasionally happens to me when working in a shared project after updating it with the latest changes. I'm not sure why, maybe their JRE installation path differs slightly from mine somehow.
检查您项目的配置
仅适用于java maven spring boot项目
我的环境
Java版本:18
Spring boot:2.75
Maven: 4.0.0
如果您不小心指定了一个在您的环境中不可用的 java 版本,它可能会回显您遇到的相同错误。
只需转到
将
18
更改为(终端命令)java --version
告诉的内容你也是。并且..
完成了。 :D
Check your Project's configuration
only applicable to java maven spring boot projects
My environment
Java version: 18
Spring boot: 2.75
Maven: 4.0.0
If your accidently specified a java version that is not available in your environment, it would probably echo the same errors you are encountering.
Just go to
<your_application_root/>/pom.xml
Change
<java.version>18</java.version>
to whatever (terminal command)java --version
tells you too.And..
Its done. :D
单击显示“Unbound classpath container: 'JRE System Library[jdk1.5.0_08]”的错误消息,左键单击任意选项选择快速修复。在快速下,可能的选项列表将会消失。选择替换库。选择您安装的库。你可以走了。
Click on the error message displaying "Unbound classpath container: 'JRE System Library[jdk1.5.0_08]", left click anyd choose quick fix. Under quick, list of possible options will get displated. Choose replace library. Choose the library you installed. Your good to go.
我在导入项目时遇到了类似的问题。
问题是您选择“使用执行环境 JRE”,该环境低于要导入的项目中使用的库。
有两种方法可以解决此问题:
1.第一次导入项目时:
2.从工作空间中删除项目并再次导入。这次:
I got the Similar issue while importing the project.
The issue is you select "Use an execution environment JRE" and which is lower then the libraries used in the projects being imported.
There are two ways to resolve this issue:
1.While first time importing the project:
2.Delete the Project from your work space and import again. This time:
对于那些使用
sdkman
的人来说,这对我很有帮助。用例:
我使用的是标识符
8.0.202-amzn
我决定按如下方式安装 Azul Zulu:
sdk install java 13.0.2-zulu
错误:
然后我得到了这个未绑定的错误。
解决方案:
1. 在
Eclipse
/STS
中右键单击您的项目2. 选择
构建路径
>配置构建路径...
3. 在“库”下,删除 JRE 库,对于我的案例
8.0.202-amzn
4. 在库下,单击
Modulepath
>添加库...
5. 选择
JRE System Library
,点击下一步6. 选择
Alternate JRE
,单击Installed JREs...
7. 您之前配置的值应该在那里
8.如果有则编辑,如果没有则添加
9. 确保
名称
为:13.0.2-zulu
10.
位置
(JRE home)是:/Users/jumping_monkey/.sdkman/candidates/java/current
11. 单击
应用并关闭
12. 单击
完成
13.瞧!
您将在项目资源管理器中看到 JRE 系统库 [13.0.2-zulu],并且所有错误都消失了
太棒了!
For those using
sdkman
, this helped me.Use Case:
I was using identifier
8.0.202-amzn
I decided to install Azul Zulu as follows:
sdk install java 13.0.2-zulu
Error:
And then i got this unbound error.
Solution:
1. Right-click on your project in
Eclipse
/STS
2. Choose
Build Path
>Configure Build Path...
3. Under Libraries, remove the JRE Library, for my case
8.0.202-amzn
4. Under Libraries, click on
Modulepath
>Add Library...
5. Choose
JRE System Library
, click Next6. Choose
Alternate JRE
, click onInstalled JREs...
7. Your previous configured value should be there
8. If it is there, edit it, if it is not there, add one
9. Make sure the
name
is:13.0.2-zulu
10. And the
location
(JRE home) is:/Users/jumping_monkey/.sdkman/candidates/java/current
11. Click
Apply and close
12. Click
Finish
13. Voila!
You will see JRE System Library [13.0.2-zulu] in your Project Explorer and all errors gone
Bravo!