How to compile rhino/javascript files to .class bytecode for java at runtime

aexyl93 picture aexyl93 · Oct 2, 2010 · Viewed 9.4k times · Source

I'm making a falling sand game in Java. I want users to be able to write their own engine for it using a simpler language. Falling sand games can be very CPU intensive so I want to have the engine running as fast as possible while not having to manually compile.

I need to know how to compile rhino javascript files to .class files by at runtime to be used.

I've looked for a way but couldn't find any other than manually compiling it by using the command line which I don't want users to have to do.

Answer

ars picture ars · Oct 2, 2010

There's a short tutorial here: