Is it possible for a program written in Java to compile a file using the JDK compiler (besides using Java to open a command line and throw out the javac command to compile the file)?
In Java 6 onwards, there is an API for using the compiler. This may be what you are looking for.
http://www.javabeat.net/2007/04/the-java-6-0-compiler-api/
http://docs.oracle.com/javase/6/docs/api/javax/tools/JavaCompiler.html
Note that you need the JDK to access the compiler. JRE will not be enough. If this is a problem, consider embedding the Eclipse Java compiler in your application.
Java 6 has a compiler API. Check out the Java Javadoc Compiler Class
and example
The Apache code password library is your friend.
http://commons.apache.org/bcel/
Source: https://habr.com/ru/post/923184/More articles:Batch - How to return a value from a batch file? - functionDefined variable undefined - javascriptCalculate near / far plane vertices using THREE.Frustum - javascriptCalculating camera borders and far plane - javascriptwpa handshake with python difficulties - pythonPlay 2.0 Java: bind an array from a query - javaHow to use jQuery cloud plugin to download images directly from a page? - jquery-pluginsAndroid ADK - work on the gamepad - androidget, set and value in C # .net - c #QueryStringBinder for list [String] - scalaAll Articles