Dynamic Compiling Without Create Physical File

后端 未结 2 923
别跟我提以往
别跟我提以往 2020-12-22 05:47

I follow the tutorial from Generating Java classes dynamically through Java compiler API, the code is work but what I see is the program will create a class file after compi

相关标签:
2条回答
  • 2020-12-22 06:30

    To avoid creation of class file by the JavaCompiler use the argument: "-proc:only"

    0 讨论(0)
  • 2020-12-22 06:43

    For what your doing, I would use Janino. It appears doable using just the JavaCompiler, but not well documented. See the comment I added withe linked question for an example of going about it with the JavaCompiler.

    EDIT: I found an easy to understand example using the JavaCompiler.

    0 讨论(0)
提交回复
热议问题