You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Kenneth B. Harwood" <ru...@comcast.net> on 2005/06/25 05:55:37 UTC
follow-up SOLUTION to classnotfound debug error
The fix is to use the Java extension mechanism (please see
http://java.sun.com/docs/books/tutorial/ext/TOC.html).
once i added the Batik JARs to my [Win2K] JDK ext folder:
copy \batik-1.6\lib\*.jar \Java\jdk1.5.0_03\lib\ext
the problem was solved. I am not exactly sure why
JApplet required use of java extensions; i was pretty
confident that a batik-aware CLASSPATH would do the
job - a misconception that was reinforced by the java
docs!
- ken harwood
When i run [my batik-1.6, sun jvm/jre] based JApplet this is what i get:
Exception in thread ... java.lang.NoClassDefFoundError: org/apache/batik/swing/svg/JSVGComponent
at StartButton.run(StartButton.java:90)
at java.lang.Thread.run(Thread.java:595)
Here is my (batik-specific) CLASSPATH:
f:\batik-1.6\lib\batik-dom.jar
f:\batik-1.6\lib\batik-svg-dom.jar
f:\batik-1.6\lib\batik-swing.jar
f:\batik-1.6\lib\batik-util.jar
f:\batik-1.6\lib\batik-awt-util.jar
f:\batik-1.6\lib\batik-bridge.jar
I realize that other Batik Jar's came with your download. In fact, those files
are in my batik/lib directory. But I have not put them in my CLASSPATH yet).
As i understand Java i do not need to add "ununsed" Jars/packages to my
CLASSPATH.
The <jar -tf> utility confirms that JSVGComponent is in my [batik-swing.jar]
file.
I can bring-up an JSVGCanvas in an application (JFrame). It's when I try to
use the Class within a JApplet that I get grief.
--------------------------------------------------------------------------------
Well it would be useful to know what class was not
found in the ClassDefNotFound error (copy the stack trace).
The problem is almost certainly an issue with your
classpath (which you also haven't included). But I don't
really have enough information to provide a solid answer.
Kenneth B. Harwood wrote:
>
> i'm running win2K. netbeans 4.0. swing/japplet. j2se (5). my applet
> bombs-out every time at the following statement:
>
>
> JSVGComponent var= new org.apache.batik.swing.svg.JSVGComponent();
> [and also when i use the JSVGCanvas class]
>
> each time it generates a *ClassDefNotFound* error.
>
> I'm pretty certain I have my CLASSPATH set-up properly.
> i get the same error when running the applet from Appletviewer.
>
> any suggestions?
>
> thanks.
>
> - ken harwood
> reno, nevada
>
> run10kswim@comcast.net <ma...@comcast.net>