Search code examples
javagoogle-app-enginejava-compiler-apidynamic-compilation

How to dynamically compile Java classes in Google App Engine


In answers to this question, I learned that it is not possible to invoke the Java Compiler in javax.tools from a GAE app.

  • Does this limitation still apply?

  • If so, what are my options for compiling Java source code into loadable class files "on the fly"?


Solution

  • No, javax.tools is still not on the Appengine's JRE Class Whitelist.

    The options you have are:

    1. Compile somewhere else and than transfer and load .class files on appengine.

    2. Try using one of embeddable Java compilers: Janino, JDT.

    3. If you can live without Java, than you might try using BeanShell for Appengine.