在 Eclipse 中配置 JAXB 编译器选项

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

Configure JAXB compiler options in Eclipse

eclipsejaxbwizard

提问by Jochem

I'm trying to generate JAXB classes from a .xsd file. I figured out that I need JAVA EE version of Eclipse to do that. If I right click on the .xsd file and choose Generate>JAXB Classes.

我正在尝试从 .xsd 文件生成 JAXB 类。我发现我需要 Eclipse 的 JAVA EE 版本才能做到这一点。如果我右键单击 .xsd 文件并选择 Generate>JAXB Classes。

I get the same wizard this guy gets in his tutorial video > http://www.youtube.com/watch?v=kOLziP28598&t=2m26s

我得到了这个人在他的教程视频中得到的相同的向导 > http://www.youtube.com/watch?v=kOLziP28598&t=2m26s

But the problem is, that if I hit next, the title in the wizard change from "Specify project for the new classes" to "Configure JAXB compiler options", but the form underneath stays the same.

但问题是,如果我点击下一步,向导中的标题会从“为新类指定项目”更改为“配置 JAXB 编译器选项”,但下面的表单保持不变。

So everytime I click next, the title in the wizard changes, but the form is still showing the project tree form from the first step

所以每次点击next,向导中的标题都变了,但是表单还是显示第一步的项目树表单

采纳答案by asura

for using JAXB in eclipse. U have to add a plugin to eclipse.

用于在 Eclipse 中使用 JAXB。你必须向 Eclipse 添加一个插件。

Download this org.jvnet.jaxbw.eclipse_1.0.0plugin and put it in your eclipse -> plugin directory.(ur indigo eclipse folder) . Restart your eclipse. Then right click on the xsd file -> JAXB 2.0 -> Run XJC.

下载这个org.jvnet.jaxbw.eclipse_1.0.0插件并将它放在你的 eclipse -> plugin 目录中。(你的 indigo eclipse 文件夹)。重启你的日食。然后右键单击 xsd 文件 -> JAXB 2.0 -> 运行 XJC。

http://rocksolutions.wordpress.com/2010/08/04/sample-on-jaxb-using-eclipse/This link explains the procedure well.

http://rocksolutions.wordpress.com/2010/08/04/sample-on-jaxb-using-eclipse/这个链接很好地解释了这个过程。

回答by darkhipo

Just had this issue, my solution was: Help>>Install New Software>>Works with:--All Available Sites--

刚刚遇到这个问题,我的解决方案是:帮助>>安装新软件>>适用于:--所有可用站点--

Search for JAXB

搜索 JAXB

Then select Web, XML, Java EE and OSGi Enterprise Development and install.

然后选择 Web、XML、Java EE 和 OSGi Enterprise Development 并安装。

After you restart Eclipse you should see the generate option.

重新启动 Eclipse 后,您应该会看到生成选项。