Eclipse Mars:配置的运行时不足以提供 JAXB2.2 的实现

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

Eclipse Mars : The configured runtime is insufficient to provide an implementation for JAXB2.2

eclipsejaxbjava-8eclipse-mars

提问by Tianyu Zhu

Eclipse version : Mars. JDK 1.8.

Eclipse 版本:火星。JDK 1.8。

I want to create a JAXB project. In the JAXB Facet page, there is the following error:

我想创建一个 JAXB 项目。在JAXB Facet页面,出现如下错误:

The configured runtime is insufficient to provide an implementation for JAXB2.2

配置的运行时不足以提供 JAXB2.2 的实现

Could you give me some suggestions on how I can fix it?

你能给我一些关于如何修复它的建议吗?

回答by josepainumkal

I faced the same problem. Below fix worked for me.

我遇到了同样的问题。下面的修复对我有用。

     1) Select File->New ->Project
     2) Choose JAXB Project from JAXB and click Next
     3) Give Project Name and click Next
     4) On the next window, just Click Next
     5) On the next window (titled JAXB Facets), Choose "User Library" for JAXB implementation. 
        Click "Download Library.." picture and choose EclipseLink 2.5.2 
        (or the higher version shown in the window) and click Next
        This will install the library (make sure your are connected to internet.)

回答by kajarigd

This is an issue with JDK8 in Eclipse, when you try creating a Generic JAXB2.2 project.

当您尝试创建通用 JAXB2.2 项目时,这是 Eclipse 中 JDK8 的问题。

For fixing the issue in Eclipse Mars, do the following: While creating the project, select your Target Runtime as JDK7 and that will fix it. I have tried it myself, and it has worked fine!

要修复 Eclipse Mars 中的问题,请执行以下操作: 在创建项目时,将目标运行时选择为 JDK7,这将修复它。我自己试过,效果很好!

If you want to continue to use JDK8, in the last screen of project creation, in JAXB implementation type, select "Disable Library Configuration" instead of JRE. This will remove the error and let you create the project. But I would suggest don't go for this as this may introduce more error in the future.

如果你想继续使用JDK8,在项目创建的最后一个屏幕,在JAXB实现类型中,选择“禁用库配置”而不是JRE。这将消除错误并让您创建项目。但我建议不要这样做,因为这可能会在未来引入更多错误。

To use JDK8 in Eclipse Luna, a patch has been published to fix this issue. You can check it here: configure Generic JAXB 2.2 Platform with Java 1.8. I haven't tried it myself, but from the comments it seems the issue is resolved.

为了在 Eclipse Luna 中使用 JDK8,已经发布了一个补丁来解决这个问题。您可以在此处查看:使用 Java 1.8 配置通用 JAXB 2.2 平台。我自己没有尝试过,但从评论看来问题已经解决了。

回答by user1158831

Here is what that worked for me (Eclipse Luna Service Release 2 (4.4.2)). In the third screen "JaxB Facet", in the JaxB Project wizard, select "User Library" as JaxB Implementation. Then click on "Manage Libraries" to create a new library with rt.jar from jdk/jre/lib folder. Now there is no error message, and the "Finish" button in the wizard is now active !

这是对我有用的(Eclipse Luna Service Release 2 (4.4.2))。在第三个屏幕“JaxB Facet”中,在JaxB Project 向导中,选择“ User Library”作为 JaxB Implementation。然后单击“管理库”以从 jdk/jre/lib 文件夹创建一个带有rt.jar的新库。现在没有错误消息,向导中的“完成”按钮现在处于活动状态!

回答by Marcelo P. Llanos C.

I solved it like this (Eclipse Oxygen with jdk8):

我是这样解决的(Eclipse Oxygen with jdk8):

  1. File/New/Project/JAXB/JAXB Project
  2. Next
  3. Give the name of the project
  4. Target Runtime: jdk8
  5. JAXB version: 2.2
  6. Next, Next
  7. Platform: Generic JAXB 2.2.
  8. JAXB Implementation Type: Disable Library Configuration.
  9. Finish.
  1. 文件/新建/项目/JAXB/JAXB 项目
  2. 下一个
  3. 给出项目名称
  4. 目标运行时:jdk8
  5. JAXB 版本:2.2
  6. 下一个,下一个
  7. 平台:通用 JAXB 2.2。
  8. JAXB 实现类型:禁用库配置。
  9. 结束。

This works.

这有效。

回答by user6904648

This is related to jdk version problem. I faced same error just we need to change jdk version from jdk1.8 to jdk1.7, to do this follow below steps... open eclipse-->select run--->Run Configrations..-->double click on java application--->select JRE--->select radio button Altenate JRE then click on installed JRE's ---> now you can remove jdk1.8 and add jdk1.7

这与jdk版本问题有关。我遇到了同样的错误,只是我们需要将 jdk 版本从 jdk1.8 更改为 jdk1.7,按照以下步骤执行此操作...打开 eclipse-->选择运行--->运行配置..-->双击java应用程序--->选择JRE--->选择单选按钮Altenate JRE然后点击安装的JRE的--->现在你可以删除jdk1.8并添加jdk1.7

enter image description here

在此处输入图片说明