Posted November 17, 20177 yr Java Compilers Some time ago I've searched over NET for java compilers, then without good results, Now I've found some: https://blogs.oracle.com/sundararajan/week-end-fun-with-the-java-compiler-source-code https://en.wikipedia.org/wiki/Javac http://janino-compiler.github.io/janino/ https://github.com/janino-compiler/janino https://stackoverflow.com/questions/616532/on-the-fly-in-memory-java-code-compilation-for-java-5-and-java-6 https://commons.apache.org/proper/commons-jci/ jci seems tom be the winner, trough is a bit outdated.
November 18, 20177 yr Isn't there that commercial Java compiler also that compiles to native code? I think its located here: https://www.excelsiorjet.com/ You should add it to the list.
December 8, 20177 yr Author Seems you can use this code directly from java:https://stackoverflow.com/questions/1320476/execute-another-jar-in-a-java-program String fileToCompile = "/Users/rupas/VolatileExample.java"; JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); int compilationResult = compiler.run(null, null, null, fileToCompile); if (compilationResult == 0) { System.out.println("Compilation is successful"); } else { System.out.println("Compilation Failed"); }
Create an account or sign in to comment