Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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, but in my old Eclipse I had the option -rightclick-generate-jaxb classes.

Who knows what I have to install/plug-in to get it back?

I was looking at installing Dali, which seems like it could be right, but I am pretty sure I did not install Dali last time. I also included the jaxb jars in my build path, as last time, so that should be ok.

I am using Eclipse 3.6 and Java SE 1.6.

like image 494
franka Avatar asked Aug 04 '11 09:08

franka


People also ask

How do you auto generate JAXB classes?

Open a command prompt. Run the JAXB schema compiler, xjc command from the directory where the schema file is located. The xjc schema compiler tool is located in the app_server_root \bin\ directory. Use the generated JAXB objects within a Java application to manipulate XML content through the generated JAXB classes.


2 Answers

If you don't have JavaEE:

Help>>Install New Software>>Works with:--All Available Sites--

Search for JAXB

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

After you restart Eclipse you should see the generate option.

like image 91
darkhipo Avatar answered Sep 23 '22 09:09

darkhipo


A simple fix for this problem - rather than worrying about adding additional plugins or installs - is to install Eclipse IDE for Java EE Developers rather than Eclipse Classic (both to be found here). This comes with the JAXB support and therefore provides the >Generate>Jaxb classes option.

like image 42
franka Avatar answered Sep 24 '22 09:09

franka