Searching the web I've found that the Javac compiler is written in Java, and I also peeked at the source on Sun's site. The source is quite big and I couldn't make any headway on it. Also the Eclipse project has a compiler embedded inside, but who could touch its source code ;-).
So I thought I'd throw a couple of questions your way:
- Could the Java compiler be hosted in an Applet?
- Could the Java compiler be made to work on GAE, with dynamic loading of the resulting class files from the datastore?
Yes, the compiler as such is really just a normal Java application (except that it usually brings its own native launcher, but that's not required).
So you can easily run it within an Applet or inside GAE.
However that won't really help too much, because if you want to actually run the produced classes, then you'd need to play with
ClassLoader
instances which is not allowed in (unsigned) Applets and probably not allowed in GAE.Only if you add the
tools.jar
to the runtime class-path of the applet. See Add the compiler to the application's runtime classpath in the STBC help for details.Not sure, though note that someone seems to have registered a Google app. by the name of 'javacompiler'. ;)