compiling and running user code with JavaCompiler and ClassLoader

前端 未结 4 2023
悲&欢浪女
悲&欢浪女 2020-12-09 07:01

I am writing web app for java learning. Using which users may compile their code on my serwer + run that code. Compiling is easy with JavaCompiler:

    Jav         


        
4条回答
  •  悲哀的现实
    2020-12-09 07:35

    Adding to Kaleb's answer, be sure to run the target JVM with a strict heap limit (eg. -Xmx16M). And, of course, you'll want to limit the number of JVMs running.

提交回复
热议问题