Eclipse 中未绑定的类路径容器

发布于 2024-08-18 08:35:14 字数 314 浏览 4 评论 0原文

我已经使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

苏别ゝ 2024-08-25 08:35: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!

追风人 2024-08-25 08:35:14

鉴于常见问题解答,共享项目文件似乎具有优势,甚至是 Java 项目的推荐做法(就我个人而言,我不会这样做)。

也许以下一些工作适合您:

  1. 编辑项目的属性(右键单击项目、属性、Java 构建路径、库、删除和添加库。
  2. 导入项目的文件,无需“项目文件”
  3. http://java.sun.com/javase/downloads/index_jdk5.jsp 并查看是否你可以修复路径

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:

  1. Edit the project's properties (right-click project, Properties, Java Build Path, Libraries, Remove and Add Library.
  2. Import the project's files without the "project file"
  3. Install JDK1.5 from http://java.sun.com/javase/downloads/index_jdk5.jsp and see whether you can fix paths
我要还你自由 2024-08-25 08:35:14

要解决此问题:

  • 右键单击您的项目 –>构建路径 –> 配置构建路径
  • 选择 JRE 库并单击“编辑”,然后从“编辑库”窗口中选择使用 Eclipse 配置的备用 JRE,然后单击“完成”

To fix this:

  • Right click your project –> Build Path –>Configure Build Path
  • Select JRE Library and click Edit and from Edit library window choose alternate JRE whatever been configured with your eclipse then click Finish
信仰 2024-08-25 08:35:14

这是一个很老的问题,我最近遇到了这个问题。答案还说确保您在 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 is JavaSE-1.8.

一影成城 2024-08-25 08:35:14

事实上,这个问题要在“首选项”->“选项”下修复。 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.

漫雪独思 2024-08-25 08:35:14
  1. 右键单击项目文件夹,转到底部的属性,
  2. 转到Java构建路径
  3. 单击库选项卡
  4. 选择 类路径
  5. 单击右侧的添加添加库按钮
  6. 选择 JRE 系统库单击 下一步,然后完成
  7. 单击 应用并关闭
    该错误应该会在 IDE 中消失。
  1. right click on the project folder go to Properties at bottom
  2. go to Java Build path
  3. click on Libraries tab
  4. select Classpath
  5. click Add Add Library button on right
  6. select JRE System Library and click Next and then Finish
  7. click Apply and Close
    the error should go away in IDE.
总攻大人 2024-08-25 08:35:14

当你

  • 导入项目文件夹到 Eclipse 工作区。(当项目使用不同的 Jre 时)。
  • 更新重新安装 eclipse
  • 更改Jre 或构建相关设置
  • 或者存在配置不匹配

对于每个配置错误的文件,会出现两个错误

  • 在解决构建路径错误之前,无法构建项目。
  • 未绑定类路径容器:“JRE 系统库”。

如果没有。有问题的项目很少:

  1. 选择每个项目并应用快速修复(Ctrl+1)
  2. 将项目的 JRE 替换为默认 JRE指定备用 JRE(或 JDK)。

您可以通过右键单击项目-->属性(从上下文菜单)-->Java 构建路径-->库--><来执行相同的操作em>选择当前未绑定的库 -->删除-->添加库-->Jre系统库-->选择默认或备用 Jre。< /p>

或者直接选择构建路径-->在项目的上下文菜单中添加库


,当您有很多项目时,摆脱此类问题的最佳方法是:

但是

  1. 在文件资源管理器中打开当前工作区(您的项目所在的位置)。
  2. 删除导入项目的 .settings 文件夹中存在的所有 org.eclipse.jdt.core.prefs 文件。(删除时要小心。不要'请勿删除 .metadata 文件夹内的任何文件或文件夹。)**
  3. 现在,选择项目的 .classpath 文件(有错误的项目)并在功能强大的文本编辑器(例如 Notepad++)中打开它们。
  4. 找到类似于的行

    并将其替换为
  5. 保存所有文件。并刷新或重新启动 Eclipse IDE。
    所有的问题都迎刃而解了。

或者

获取项目使用的 JRE 并安装在您的计算机上,然后指定它..

The problem happens when you

  • Import project folders into the eclipse workspace.(when projects use different Jre).
  • Update or Reinstall eclipse
  • Change Jre or Build related Settings.
  • Or by there is a configuration mismatch.

You get two errors for each misconfigured files.

  • The project cannot be built until build path errors are resolved.
  • Unbound classpath container: 'JRE System Library.

If the no. of projects having problem is few:

  1. Select each project and apply Quick fix(Ctrl+1)
  2. Either Replace the project's JRE with default JRE or Specify Alternate JRE (or JDK).

You can do the same by right-click project-->Properties(from context menu)-->Java Build Path-->Libraries-->select current unbound library -->Remove-->Add Libraries-->Jre System library-->select default or alternate Jre.

Or directly choose Build Path-->Add libraries in project's context menu.


But the best way to get rid of such problem when you have many projects is:

EITHER

  1. Open the current workspace (in which your project is) in File Explorer.
  2. Delete all org.eclipse.jdt.core.prefs file present in .settings folder of your imported projects.(Be careful while deleting. Don't delete any files or folders inside .metadata folder.)**
  3. Now,Select the .classpath files of projects (those with errors) and open them in a powerful text editor(such as Notepad++).
  4. Find the line similar to
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
    and replace it with
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
  5. Save all the files. And Refresh or restart Eclipse IDE.
    All the problems are gone.

OR

Get the JRE used by the projects and install on your computer and then specify it..

各自安好 2024-08-25 08:35:14

即使安装了 JDK 1.7 后我也遇到了同样的问题。我通过将 bin 目录添加到我的 PATH 中来纠正它。所以我去了

计算机>属性>高级>环境变量

然后添加

C:\Program Files\Java\jdk1.7.0_55\bin;

然后我按照这些说明操作

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

computer>properties>advanced>environment variables

and then added

C:\Program Files\Java\jdk1.7.0_55\bin;

then I followed these instructions

http://clean-clouds.com/2012/12/06/how-to-install-and-add-jre7-in-eclipse/

把昨日还给我 2024-08-25 08:35:14

在已配置的工作区中,它刚刚停止构建:

1. Right click the error
2. Select quick fix
3. Use workspace default JRE

在使用最新更改更新共享项目后,我偶尔会发生这种情况。我不知道为什么,也许他们的 JRE 安装路径与我的略有不同。

In an already configured workspace where it just stopped building:

1. Right click the error
2. Select quick fix
3. Use workspace default JRE

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.

源来凯始玺欢你 2024-08-25 08:35:14
  1. 转到首选项
  2. 搜索 Java -->安装的 JRE
  3. 确保列表中至少添加一个 jdk(图 1)

Image 1

  1. 单击“应用”,然后单击“应用并关闭”,
  2. 然后右键单击项目并单击底部的“属性”。
  3. 点击Java --> Java 构建路径 --> “库”选项卡
  4. 在“类路径”下,通过选择并单击“现在删除”来删除 JRE 系统库,
  5. 然后单击“类路径”并添加“AddLibrary -->” JRE系统库 -->工作区默认JRE -->完成-->申请-->应用并关闭(图2)
    图片 2
  6. 右键单击​​您的项目 -->构建项目
  1. Go to Preferences
  2. Search for Java --> Installed JREs
  3. Ensure at least one jdk is added in the list (Image 1)

Image 1

  1. Click on Apply and then "Apply and Close"
  2. Then right click on project and click on Properties at the bottom.
  3. Click on Java --> Java Build Path --> Libraries tab
  4. Under Classpath remove JRE system libraries by selecting and clicking on Remove
  5. Now click on Classpath and add on AddLibrary --> JRE System Library --> Workspace default JRE --> Finish--> Apply --> Apply and Close (Image 2)
    Image 2
  6. Right click your project --> Build Project
猫烠⑼条掵仅有一顆心 2024-08-25 08:35:14

检查您项目的配置

仅适用于java maven spring boot项目

我的环境

Java版本:18

Spring boot:2.75

Maven: 4.0.0

如果您不小心指定了一个在您的环境中不可用的 java 版本,它可能会回显您遇到的相同错误。

只需转到

  1. /pom.xml

  2. 18 更改为(终端命令)java --version 告诉的内容你也是。
    屏幕截图pom.xml

并且..
完成了。 :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

  1. <your_application_root/>/pom.xml
    just go to this

  2. Change <java.version>18</java.version> to whatever (terminal command) java --version tells you too.
    Screengrab of pom.xml

And..
Its done. :D

吾家有女初长成 2024-08-25 08:35:14

单击显示“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.

握住我的手 2024-08-25 08:35:14

我在导入项目时遇到了类似的问题。

问题是您选择“使用执行环境 JRE”,该环境低于要导入的项目中使用的库。

有两种方法可以解决此问题:

1.第一次导入项目时:

in JRE tab select "USE project specific JRE" instead of "Use an execution environment JRE".

2.从工作空间中删除项目并再次导入。这次:

select "Check out as a project in the workspace" instead of "Check out as a project configured using the new Project Wizard"

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:

in JRE tab select "USE project specific JRE" instead of "Use an execution environment JRE".

2.Delete the Project from your work space and import again. This time:

select "Check out as a project in the workspace" instead of "Check out as a project configured using the new Project Wizard"
挽你眉间 2024-08-25 08:35:14

对于那些使用 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 Next
6. Choose Alternate JRE, click on Installed 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文