Java 在构建路径中获取 JRE 系统库未绑定错误

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

getting JRE system library unbound error in build path

javaeclipsemavenclasspathbuildpath

提问by user1328572

getting a JRE system library unbound error in build path, tried all suggestions from the below links, however did not work. I have jdk 1.6.0_29, I have also tried to install other versions but no help.

在构建路径中出现 JRE 系统库未绑定错误,尝试了以下链接中的所有建议,但没有奏效。我有 jdk 1.6.0_29,我也尝试安装其他版本但没有帮助。

JRE System Library [WebSphere v6.1 JRE] (unbound)Eclipse error: Unbound classpath containerJava - Unbounded classpath container Websphere V6 JREStruggling to update JRE dependencies within Maven and EclipseUnbound classpath container in Eclipseunbound class path container error in eclipse?Java Web Project Build Errorunbound class path container error in eclipse?

JRE 系统库 [WebSphere v6.1 JRE](未绑定)Eclipse 错误:未绑定类路径容器Java -未绑定类路径容器 Websphere V6 JRE 正在努力更新 Maven 和 Eclipse 中的 JRE 依赖项Eclipse未绑定类路径容器在 Eclipse中出现错误?Eclipse 中的Java Web 项目构建错误未绑定类路径容器错误?

maven compiler version is something like this:

maven 编译器版本是这样的:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <encoding>${project.build.sourceEncoding}</encoding>
        <showDeprecation>true</showDeprecation>
    </configuration>
</plugin>

回答by user1328572

oh boy, this got resolved, I just had to name my Installed JRE appropriately. I had only the jdk installed and eclipse had taken the default jdk name, i renamed it to JavaSE-1.6 and voila it worked, though i had to redo everthing from the scratch.

哦,天哪,这已经解决了,我只需要适当地命名我的已安装 JRE。我只安装了 jdk 并且 eclipse 使用了默认的 jdk 名称,我将它重命名为 JavaSE-1.6,瞧它起作用了,尽管我不得不从头开始重做所有事情。

回答by user3076252

Another option is:

另一种选择是:

  • Project > Properties > Java Build Path
  • Select Libraries tab
  • Select the troublesome JRE entry
  • Click Edit button
  • Choose an alternate JRE
  • Click Finish button
  • 项目 > 属性 > Java 构建路径
  • 选择库选项卡
  • 选择麻烦的JRE入口
  • 单击编辑按钮
  • 选择备用 JRE
  • 单击完成按钮

Pointing the project at your installed JRE might be a better choice than renaming your JRE to match the old project code.

将项目指向已安装的 JRE 可能比重命名 JRE 以匹配旧项目代码更好。

回答by Louise

This is like user3076252's answer, but you'll be choosing a different set of options:

这就像 user3076252 的答案,但您将选择一组不同的选项:

  • Project> Properties> Java Build Path
  • Select Libraries tab> Alternate JRE> Installed JREs...
  • Click "Search." Unless you know the exact folder name, you should choose a drive to search.
  • 项目>属性> Java 构建路径
  • 选择库选项卡>备用 JRE>已安装的 JRE...
  • 点击“搜索”。除非您知道确切的文件夹名称,否则您应该选择要搜索的驱动器。

It should find your unbound JRE, but this time with all the numbers in it's name (rather than unbound), and you can select it. It will take a while to search the drive, but you can stop it at any time, and it will save the results, if any.

它应该会找到您未绑定的 JRE,但这次包含其名称中的所有数字(而不是未绑定),您可以选择它。搜索驱动器需要一段时间,但您可以随时停止它,它会保存结果(如果有)。

回答by Bharti Rawat

Go to project then

然后转到项目

Right click on project---> Build Path-->Configure build path

Now there are 4 tabs Source, Projects, Libraries, Order and Export

现在有 4 个选项卡Source、Projects、Libraries、Order 和 Export

Go to

Libraries tab -->  Click on Add Library (shown at the right side) -->
select JRE System Library --> Next-->click Alternate JRE --> select
Installed JRE--> Finish --> Apply--> OK.

回答by Jorge Santos Neill

The solution that work for me is the following:

对我有用的解决方案如下:

  1. Select a project
  2. Select the project menu
  3. Select properties sub-menu
  4. In the window "properties for 'your project'", select Java Build Path tab
  5. Select libraries tab
  6. Select the troublesome JRE entry
  7. Click on edit button
  8. Select JRE entry
  9. Click on finish button
  1. 选择项目
  2. 选择项目菜单
  3. 选择属性子菜单
  4. 在“您的项目的属性”窗口中,选择 Java Build Path 选项卡
  5. 选择库选项卡
  6. 选择麻烦的JRE入口
  7. 点击编辑按钮
  8. 选择 JRE 条目
  9. 点击完成按钮