Create .java file and compile it to a .class file at runtime

前端 未结 2 1343
暗喜
暗喜 2021-01-16 05:37

I\'m generating a whole bunch of .java files from an XSD file using XJC. I also need to compile those files to .class files and use them at runtime via reflection.

T

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-16 06:14

    Have you tried looking up existing threads for the same topic ; On-the-fly, in-memory java code compilation for Java 5 and Java 6

    for example.

提交回复
热议问题