I'm trying to create a sample java installed extension based on the Sun Tutorial at:
I've created a class file called RectangleArea.java containing:
public final class RectangleArea
public static int area( java.awt.Rectangle r )
return r.width * r.height;
I've compiled it into a class file and then JARed it into a file called area.jar, which I copied into the JAVA_HOME/jre/lib/ext directory.
Then I've created a java source file called AreaApp.java containing:
public class AreaApp
public static void main( String args )
int width = 10;
int height = 5;
Rectangle r = new Rectangle(width, height);
System.out.println( "The rectangle's area is " +
RectangleArea.area( r ) );
I've compiled this file (with the RectangleArea.java class in the current directory) and then tried to run it using "java AreaApp", but I get a "NoClassDefFoundError" for "RectangleArea".
I'm not sure what else I'm supposed to do. According to the tutorial and the Extension docs, all I have to do is jar a class file and place it into the correct directory... I'm on Win2K using the 1.4 JDK.