• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem setting Environment Variable

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ??
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ..
reply
    Bookmark Topic Watch Topic
  • New Topic