How can I get the “Eclipse >Generate>Jaxb classes” option back?

前端 未结 10 1180
悲&欢浪女
悲&欢浪女 2020-12-15 15:43

I recently had to migrate to a new machine and re-installed Eclipse. At the moment, I need to generate JAXB classes from an xsd. I cannot quite remember what I installed, b

10条回答
  •  余生分开走
    2020-12-15 16:21

    In order to support the standard JAXB APIs in the IntelliJ IDEA Community Edition environment, you need to make some adjustments. One way to implement JAXB technology is to connect the xjc.exe utility included in the JDK toolkit. This utility can be launched at the command prompt, but it is advisable to configure the context menu:

    • In the Settings window, select Tools | External Tools and press the "+" button.
    • In the Edit Toolbox dialog enter:

      • the name (Name :) of the new Generate JAXB Classes command;
      • the path to the xjc.exe utility (Program :), which should be selected on the particular computer in the file selection dialog(button "..." )`
      • parameters (Parameters :) which in our case will be as follows:

        $ p $ FileFQPackage $ $ SourcepathEntry $ $ FilePath $

    In order for the created command to work correctly, the schema file should be placed in a new package, which will then appear with the generated files.

    In the settings window, Tools | External Tools - "Your command name" will appear. All you need is to open your schema file and run the command.

提交回复
热议问题