Skip to content
Advertisement

java.lang.NoClassDefFoundError while reading a svg file as BufferedImage

i have a .svg file to create a Map which will have Listeners relevant to boundaries (i guess its called “nodes” of a scalable vector graphic). However, i’m trying to add this file as a BufferedImage over a JPanel. (i’m a newbie about swing components so if you have any better ideas please share ). Moreover, i used Batik library and read some information about it and i used this code sample to get this .svg file as BufferedImage

JavaScript

this is my class to use GUI components and the part where i try to use BufferedImage

JavaScript

and finally, Test program which contains main method.

JavaScript

Well my problem is compiler gives an error which is

JavaScript

and the whole error is

JavaScript

i will be very very appreciated if you can help about this topic even with useful suggesstions! And thanks anyway

Advertisement

Answer

The following post my address your issue:
Batik not in classpath

It seems as if the jar file may not be included in the Batik download, you can just download the needed jar library and add it to your project.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement