java eclipse indigo 中的 Jaxb 项目

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

Jaxb project in eclipse indigo

javajaxbeclipselinkmoxy

提问by Kamal

When I create a jaxb project in eclipse indigo, it tells me "The currently selected JAXB library provider is invalid" which is eclipselink2.3.0-Indigo I tried the javanet download jars with no success. i can though try the examples in the demo described here: http://wiki.eclipse.org/EclipseLink/Examples/MOXy/GettingStartedwith the exception of the part on MOXy customization. No error when i run, it just does not seem to be doing anything.

当我在 eclipse indigo 中创建一个 jaxb 项目时,它告诉我“当前选择的 JAXB 库提供程序无效”,即 eclipselink2.3.0-Indigo 我尝试了 javanet 下载 jars 没有成功。我可以尝试此处描述的演示中的示例:http: //wiki.eclipse.org/EclipseLink/Examples/MOXy/GettingStarted 除了关于 MOXy 定制的部分。我运行时没有错误,它似乎没有做任何事情。

What am i missing. Thanks in advance. Kamal

我错过了什么。提前致谢。卡迈勒

回答by bdoughan

Background Info

背景信息

The Eclipse Indigo releaseoffers some new JAXB tooling from the Dali project(which is part of Web Tools Platform). You are now able to create a JAXB Project.

Eclipse的靛蓝的释放提供了从一些新的JAXB工具大理项目(这是部分Web工具平台)。您现在可以创建JAXB 项目

Configuration

配置

A JAXB project can be configured to use the referenceor EclipseLink MOXyimplementation of JAXB. This can be done via:

JAXB 项目可以配置为使用 JAXB 的参考EclipseLink MOXy实现。这可以通过:

  1. Right click your JAXB Project
  2. Select Properties
  3. Select Project Facets
  4. Check the JAXBfacet (If you are using Java SE 6 set the JAXB version to 2.1, if you are using Java SE 7 then set the JAXB version to 2.2).
  5. Click the "Further configuration required" or "Further configuration available" links.
  1. 右键单击您的 JAXB 项目
  2. 选择属性
  3. 选择项目方面
  4. 检查JAXB方面(如果您使用的是 Java SE 6,请将 JAXB 版本设置为 2.1,如果您使用的是 Java SE 7,则将 JAXB 版本设置为 2.2)。
  5. 单击“需要进一步配置”或“可用的进一步配置”链接。

Using the JAXB RI

使用 JAXB RI

  • Choose Generic JAXBas your platform
  • Choose JREas your JAXB Implementation Type
  • 选择Generic JAXB作为您的平台
  • 选择JRE作为您的 JAXB 实现类型

Using EclipseLink JAXB (MOXy)

使用 EclipseLink JAXB (MOXy)

  • Choose EclipseLink JAXBas your platform
  • Choose User Libraryas your JAXB Implementation
  • Click the Manage Libraries... icon
  • Add a new User Library for EclipseLink (the binary can be obtained from http://www.eclipse.org/eclipselink/downloads/).

  • 选择EclipseLink JAXB作为您的平台
  • 选择用户库作为您的 JAXB 实现
  • 单击管理库...图标
  • 为 EclipseLink 添加一个新的用户库(二进制文件可以从http://www.eclipse.org/eclipselink/downloads/获得)。