0

I'm trying to run Jibx CodeGen in the command line to generate Java source files from xml schema (xsd) files. However, it seems I'm not even able to run CodeGen. I know I should provide at least the input xsd as parameter, but CodeGen crashes before, so it does not matter here.

java -cp "~/.m2/repository/org/jibx/jibx-tools/1.2.3/jibx-tools-1.2.3.jar" org.jibx.schema.codegen.CodeGen 

Exception in thread "main" java.lang.NoClassDefFoundError: org.jibx.schema.codegen.CodeGen
Caused by: java.lang.ClassNotFoundException: org.jibx.schema.codegen.CodeGen
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Could not find the main class: org.jibx.schema.codegen.CodeGen.  Program will exit.

I've opened the jar and it seems the class package is correct.

Any ideas?

Alan Evangelista
  • 2,888
  • 6
  • 35
  • 45

1 Answers1

0

There are two ways to run JiBX codegen:
1. Run it as a maven plugin.
2. Run it standalone.

I highly recommend running JiBX as a maven plugin. You will find lots of documentation and examples at: http://jibx.sourceforge.net/maven-jibx-plugin/index.html

If you want to run JiBX as a stand-alone program, you will need to have all the executable jars in the same directory. You can simplify your setup by downloading the entire package from our sourceforge page at: http://sourceforge.net/projects/jibx/

Mike Cole
  • 14,474
  • 28
  • 114
  • 194
Don Corley
  • 496
  • 2
  • 7