I am making a tool that will write .java files, then (hopefully) compile those files to .class files. All in one process, the user selects a file directory where multiple .java files are written. Now I want the program to compile these Java files.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
JavaCompiler
is your friend. Check the documentation hereAnd here an example on how you could use the compiler API
The
JavaCompiler
will benull
if the code is running from a JRE. It needs a JDK, which includes thetools.jar
.