Android runs Dalvik, not Java 6. JavaCompiler is not part of the standard Dalvik distribution, so you cannot use it. Dalvik's uptime is for the embedded system because it is less dynamic, compiling code on the fly is one of the things that it shouldn't do.
Try what Xangelo or Google suggested for other script libraries. Clojure for example .;)
source share