I'm trying to use a custom shapes library it works fine in the editor but when I export to a jar file I get a no class def found error
I have the library in Program Files (x86)\Greenfoot\lib\userlib and in project/libs (I made the libs folder)
I other discusions said to add this :
static {
final NativeLoader loader = new NativeLoader();
loader.addClasspath( "./+libs/jshapes.jar" );
loader.loadClass( "sl.shapes.StarPolygon");
}
to the world class (I assume outside of any method)
but greenfoot can't find NativeLoader and I couldn't find where to import it from.
So where do I import it from and is my code/library location correct?
java.lang.NoClassDefFoundError: sl/shapes/StarPolygon at ExplodingBullet.<init>(ExplodingBullet.java:33) at ExplodingBullet.<init>(ExplodingBullet.java:50) at Shooter.shootExploding(Shooter.java:70) at Boss1.act(Boss1.java:394) at greenfoot.core.Simulation.actActor(Simulation.java:594) at greenfoot.core.Simulation.runOneLoop(Simulation.java:552) at greenfoot.core.Simulation.runContent(Simulation.java:215) at greenfoot.core.Simulation.run(Simulation.java:205) Caused by: java.lang.ClassNotFoundException: sl.shapes.StarPolygon at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 8 more
