将hyperjaxb采购订单教程导入Eclipse [英] Importing hyperjaxb purchase order tutorial into Eclipse

查看:131
本文介绍了将hyperjaxb采购订单教程导入Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将本教程中的示例应用程序导入蚀。我不断收到与文件放置位置相关的错误。当我在教程中创建一个Main类来运行代码时,我从Eclipse中获取编译错误,当主类在构建路径中时,我没有看到所需的包,或者我得到一个

I would like to import the sample app from this tutorial into eclipse. I keep getting errors related to where the files get placed. When I create a Main class to run the code in the tutorial, I either get compilation errors from Eclipse not seeing the required packages when the Main class is in the build path, or I get a


启动错误:Section不包含主类型

Launch Error: Section does not contain a main type

当主类是不在构建路径。

when the Main class is not in the build path.

到目前为止,我已采取以下步骤:

So far, I have taken the following steps:


  1. 下载zip

  2. 导航到cmd.exe中的文件夹

  3. 运行mvn clean install

  4. 在eclipse中创建新的maven项目

  5. 将以下内容添加到pom.xml中

  6. 在eclipse中运行Maven更新项目

  7. 创建目标/生成-sources / xjc文件夹

  8. 将hyperjaxb生成的文件导入
    target / generated-sources / xjc

  9. 在其他地方创建一个Main类在eclipse项目中运行测试
    代码


  10. 的使用JAXB和JPA部分开始添加代码到教程到主类

  1. Download zip
  2. Navigate to folder in cmd.exe
  3. Run mvn clean install
  4. Create new maven project in eclipse
  5. Add the below to the pom.xml
  6. Run Maven update project in eclipse
  7. Create target/generated-sources/xjc folder
  8. Import the files generated by hyperjaxb into target/generated-sources/xjc
  9. Create a Main class elsewhere in the eclipse project to run test code
  10. Start adding code from the "Working with JAXB and JPA" section of the tutorial to the Main class

上述步骤导致上述错误。
在Eclipse中使用哪种分步说明?

The above steps result in the errors I described above. What are step by step instructions for getting this to work in Eclipse?

推荐答案

该解决方案涉及右键单击eclipse项目中的各种文件夹,选择 Build Path .. ,然后使用试错选择用作源文件夹配置构建路径从构建路径删除为各种文件夹尝试以重建项目架构所需的构建路径。在lexicore的答案中的一些概念是有帮助的,但最终需要手工构建路径在eclipse之前的变化,应用程序可以在没有抛出错误的情况下进行封送。

The solution involved right-clicking on various folders in the eclipse project, choosing Build Path.. and then using trial and error to select either Use as Source Folder, Configure Build Path, or Remove from Build Path for various folders in an attempt to recreate the build path required by the project's architecture. Some of the concepts in lexicore's answer were helpful, but ultimately required manual build path changes in eclipse before the app could marshal without throwing errors.

必须有一种方法来演进超级脚本的架构,以便不需要这些手动步骤。我想象,更改 pom 以正确定义构建路径将是一个短期解决方案。 JAXB允许将生成的代码导入到eclipse中,而不需要所有这些手动配置要求,这可能是因为JAXB jar中的代码可能与目录结构无关。

There must be a way for the architecture of hyperjaxb to be evolved so that these manual steps are not required. I would imagine that changing the pom to define the build path properly would be a short term solution. JAXB allows generated code to be imported into eclipse without all these manual configuration requirements, perhaps because the code in the JAXB jars may be agnostic with respect to directory structure.

这篇关于将hyperjaxb采购订单教程导入Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆