Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Producing java classes from xsd file - JAXB

I'm trying to learn to produce webservices with Java. I have added JAXB plugin to eclipse/plugin folder and I restarted eclipse. I have added a .xsd file to the source folder under eclipse and I am trying to generate classes from the xsd file. The tutorial mentions that, when I right click on the .xsd file, I should see an option called "JAXB 2.1 - > run XJC", but I don't see any such option on my eclipse installation. I only see "Generate - > JAXB Classes option". If I select this option and force it build classes, it gives out an error saying:

The classpath for this project does not appear to contain the necessary libraries to proceed with class generation.
Please insure that a JAXB implementation is available on the classpath. Couldn't find the main class com.sun.tools.xjc.XJFacade.

Can someone help me to figure out why am I not seeing that option under eclipse? I tried both galileo and Helios.

like image 209
RKodakandla Avatar asked Jul 14 '11 17:07

RKodakandla


1 Answers

Check with the installed JRE in eclipse

Preference > Java > Installed JRE

If it points to jre then point it to jdk installation directory. It fixed the error for me

like image 146
ragav Avatar answered Sep 19 '22 15:09

ragav