[jdom-interest] Using JDOM with Microcoft Java VM + Internet Explorer (Fixing NoClassDefFoundError) (Archive purposes)

Jake Latham jlatham at rockysoft.com
Fri Jun 29 14:00:48 PDT 2001


OK - Thanks Ian for the comment that sparked the idea - I was able to get
things working.

Here's what I did to get it working, in case this saves anybody time in the
future.  From what I was able to gather from reading the archives, if you're
getting NoClassDefFound errors, then your compiler or runtime environment
doesn't know where the proper .jar files are.

solution: set the path so that the compiler or runtime environment can find
it.  For normal Java Apps, apparently this means setting the CLASSPATH
environment variable.

I was getting this error when trying to run the program as an applet under
Internet Explorer, but it compiled fine, since the classpath included
jdom.jar and xerces.jar.

So, set the Classpath for Microsoft's VM open up the registry editor
(start->run->regedit) and go to the key:

MY Computer\HKLocalMachine\Software\Microsoft\Java VM\ClassPath

edit that to include a path that points to your jdom.jar and any other.jar
files you need.  Mine only worked when I hard-coded the path, using
%JAVA_HOME% didn't work for me for some reason.

Save it, and retry your app - it should be OK if you've gotten the correct
paths.  For example's sake, here's what mine looks like now:

"%systemroot%\java\classes;C:\Java\jre\lib\ext;C:\Java\jre\lib\ext\jdom.jar;
C:\Java\jre\lib\ext\xerces.jar;C:\Programming\Shout3D\Shout3d_runtime\codeba
se;"

I hope this helps somebody in the future...

-Jake
RockySoft Corporation
2301 Research Boulevard - Suite 202
Jake Latham
Code Monkey
Phone:  (970) 493-0868 x112
Fax:    (970) 493-0887


-----Original Message-----
From: tril at www2.blackwell.co.uk [mailto:tril at www2.blackwell.co.uk]On
Behalf Of Ian Lea
Sent: Friday, June 29, 2001 2:08 PM
To: jlatham at rockysoft.com
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Getting Started...and stalled by SAXBuilder
error. Help?


I'd say it HAS to be because jdom.jar isn't being found at runtime.
Are you absolutely, completely, positive it is in the classpath
used at runtime?


--
Ian.
ian.lea at blackwell.co.uk


Jake Latham wrote:
>
> Hi all!
>
> As if you couldn't tell, I'm new to the list.  I've done a lot with XML,
but
> not so much with Java, so I'm still trying to get acclimatized.  I built
the
> jdom package and have been able to compile my code OK, but at runtime, I'm
> getting a SAXBuilder error.  I searched the archives and couldn't find
> anything that worked for me, so I thought I'd see if you folks could help.
>
> Here are the particulars.
>
> 1.) The error:
> Exception occurred during event dispatching:
> java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
>  at applets/VITPanel.checkForNodeClicked (vitpanel.java:373)
> ...
>
> 2.) Import Statements:
> package applets;
>
> import shout3d.core.*;
> import shout3d.math.*;
> import shout3d.*;
>
> import java.net.*;
> import java.io.*;
>
> import org.jdom.*;
> import org.jdom.input.SAXBuilder;
> import org.jdom.output.*;
> import java.util.*;
>
> 3.) The actual code:
> SAXBuilder saxBuilder = new SAXBuilder();   ;-) Complex I know :-)
>
> 4.) CLASSPATH and JAVA_HOME:
> JAVA_HOME = C:\Java
>
> CLASSPATH =
>
%JAVA_HOME%\jre\lib\ext\jdom.jar;%JAVA_HOME%\jre\lib\ext\xerces.jar;C:\Progr
> amming\Shout3D\Shout3d_runtime\codebase;
>
> I know it must be something related to the path information, but I don't
> really know what it is - can you help me out?
>
> Thanks a bunch,
>
> -J




More information about the jdom-interest mailing list