public class MainClass{ public static void main(String[] argv){ System.exit(9); } } The exit method should not be called in a Java applet. It is the Web browser's responsibility to halt the JVM as needed.