Java2Script provides an Eclipse Java to JavaScript transpiler, with a nearly complete implementation of the Java Virtual Machine with AWT and Swing in JavaScript, with simple, automated parallel creation of both class files and js files. To date, over 600 applets have been converted.
Creating an instance of an error e.g.
new Error("error message");
throws TypeError: this.fillInStackTrace$ is not a function.