This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem setting Environment Variable

 
Monoj Roy
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am trying to run xjc.bat from comand prompt .
It is giving an error message as follws

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xerces/xni
/parser/XMLErrorHandler
at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:518)
at com.sun.tools.xjc.Driver.run(Driver.java:374)
at com.sun.tools.xjc.Driver._main(Driver.java:113)
at com.sun.tools.xjc.Driver.access$000(Driver.java:77)
at com.sun.tools.xjc.Driver$1.run(Driver.java:93)
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.xni.parser.XMLErr
orHandler
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 5 more


Now I am having this org.apache.xerces.xni.parser.XMLErrorHandler.class file
in xcresImpl.jar and I have put this jar in CLASSPATH variable in the environment variable .I also have inclued the CLASSPATH in PATH as well
But still I am facing the same problem .. Can you please guide where to put
this jar so it will run from the command prompt ??
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have put this jar in CLASSPATH variable in the environment variable


Did you give a complete path including the jar file name? Sometimes people forget that most of the time giving the directory is not enough.

What version of Java are you using?

Bill
 
Monoj Roy
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for giving interest to my post

CLASSPATH : C:\Monoj\Monoj_DATA\Jar_Search\XercesImpl\xercesImpl.jar


PATH: C:\Program Files\ThinkPad\Utilities;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\IBM\Infoprint Select;C:\Notes;C:\Program Files\XLView;C:\lotus\compnent;C:\Utilities;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Trace Facility\;C:\Program Files\Intel\Wireless\Bin\;C:\Program Files\ThinkPad\ConnectUtilities;C:\WINDOWS\Downloaded Program Files;C:\Program Files\ZipGenius 6\;C:\PDOS\PDOS_data\9_04_2008;%CUSTOR_XML_SCHEMA_JAR%;%JAVA_HOME%;%JAXB_HOME%;%CLASSPATH%;C:\Monoj\Monoj_DATA\Jar_Search\xercesImpl.jar

JAVA_HOME : C:\Program Files\Java\jdk1.6.0_10\bin

JAXB_HOME : C:\jaxb\jaxb-1.0\bin



Here I have listed the Key Environment variables .
I am using JDK 1.6
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not used the latest Xerces, but is that the only jar file you need?

The install page seems to indicate you may need others such as xml-apis.jar.

Were you able to run any of the Xerces sample classes?

Bill
 
Monoj Roy
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just have downloaded the JAXB 2.1 and the new xjc.bat runs perfectly ..Thank s for your support ..
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic