SixTen
09-09-2004, 02:18 PM
I'm having problems when I try to run my program. It compiles just fine, but when I go to run it I get this:
java.lang.NoSuchMethodError: main
Exception in thread "main" Here is my program:
import aLibrary.*;
public class Director {
private SimpleWindow window;
private GrayCircle circle;
public Director() {
window = new SimpleWindow();
circle = new GrayCircle();
circle.place(window);
window.repaint();
}
}
So after I got this I tried a much simpler 'Hello World' and I made sure it had a 'main' method.
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
This program works, but the other one doesn't. I replaced the 'public Director()' with 'public void main()' but I get the same error. Can anyone tell me how to fix this? The first program runs just fine on the Solaris Machines in class, just not at home.
java.lang.NoSuchMethodError: main
Exception in thread "main" Here is my program:
import aLibrary.*;
public class Director {
private SimpleWindow window;
private GrayCircle circle;
public Director() {
window = new SimpleWindow();
circle = new GrayCircle();
circle.place(window);
window.repaint();
}
}
So after I got this I tried a much simpler 'Hello World' and I made sure it had a 'main' method.
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
This program works, but the other one doesn't. I replaced the 'public Director()' with 'public void main()' but I get the same error. Can anyone tell me how to fix this? The first program runs just fine on the Solaris Machines in class, just not at home.