Search code examples
javaclasspathjibx

Cant call JIBX CodeGen.


I want to create java classes from xml files. I use JIBX. I try this:

java -cp C:\Documents and Settings\kliver\Мои документы\Загрузки\jibx\lib\jibx-tools.jar org.jibx.schema.codegen.CodeGen -t C:\Documents and Settings\kliver\Мои документы\Загрузки\jibx\gen\ -w C:\Documents and Settings\kliver\Мои документы\Загрузки\jibx\V01_STD\STD_MP.xsd

But get error

C:\Documents and Settings\kliver>java -cp C:\Documents and Settings\kliver\Мои д
окументы\Загрузки\jibx\lib\jibx-tools.jar org.jibx.schema.codegen.CodeGen -t C:\
Documents and Settings\kliver\Мои документы\Загрузки\jibx\gen\ -w C:\Documents a
nd Settings\kliver\Мои документы\Загрузки\jibx\V01_STD\STD_MP.xsd
Exception in thread "main" java.lang.NoClassDefFoundError: and
Caused by: java.lang.ClassNotFoundException: and
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: and.  Program will exit.

I add C:\Documents and Settings\kliver\Мои документы\Загрузки\jibx\lib\ to PATH and CLASSPATH variables but its not help.

What i can foggot to do?


Solution

  • Seems like the word 'and' is interpreted as a java class. Try putting the paths refered to in the command line in quotes:

    java -cp "C:\Documents and Settings\kliver\Мои д окументы\Загрузки\jibx\lib\jibx-tools.jar" .... etc