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

102,947

Solution 1

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.

Solution 2

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.

Solution 3

The above methods may work, but actually the options comes from a plugin called Web Tools Platform which comes along with Eclipse IDE for Java EE Developers.

Don't worry about reinstalling eclipse or try out other methods. No matter what eclipse you use simply install this plugin by following the below procedure. You will get the "JAXB Classes" Option on click of "Generate" button.

Help --> Install New Software --> Add

Name : Web Tools Platform
Location : http://download.eclipse.org/webtools/repository/helios

Hint : In case if you are using a different version replace helios with your eclipse version name. I used it as luna. So the path looks like http://download.eclipse.org/webtools/repository/luna

And restart eclipse. Now you will have that option.

Solution 4

After a lot of research here is what I have done to fix the issue. Windows> Preferences> Java> InstalledJREs...make sure to point your jre to the jdk directory. I was pointing to JRE and as soon as I changed it to JDK, it started working. Hope this will help you guys.

Solution 5

(I'm using IBM's Eclipse-based RAD, so I don't know whether this applies to raw Eclipse.)

Have a look at your project Facets (select project, rightClick->Properties, Project Facets) I have the option of selecting JAX/RS.

later: I've checked my plugins and by default I get Dali installed and it does contain some JAX/B-related stuff. I suspect you do need this.

Share:
102,947
franka
Author by

franka

Updated on August 07, 2020

Comments

  • franka
    franka almost 4 years

    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.

  • franka
    franka almost 13 years
    thanks for the effort :) Turns out I didn't have the jaxb installed properly.
  • Crystark
    Crystark over 7 years
    This is the way to go if you want to just add JAXB Support. You only need to install Dali Java Persistence Tools - JAXB Support, not the whole group.