Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - Dynamic Compilation without JDK

im aware that j2se 6 has introduced the JavaCompiler API; however, it's cumbersome to use and require a JDK not JRE.

Is it possible to do dynamic compilation without a JDK? (im very interested in all-in-memory compilation.)

additionally, i expect the performance to be close to raw java code, so i don't want to use a scripting language like BeanShell or Groovy.

thank you.

like image 368
Defd Avatar asked Nov 14 '25 15:11

Defd


1 Answers

You might be interested in Janino, particularly SimpleCompiler. For in-memory compilation, you can use the Reader constructor, and a StringReader.

like image 182
Matthew Flaschen Avatar answered Nov 17 '25 09:11

Matthew Flaschen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!