Jump to content

Dynamically compile and run Java code

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Exem

Exem

    Newbie

  • Members
  • PipPip
  • 12 posts
Hello,

I'm writing an intelligent tutoring program, and I would like to run java code that is saved into a text file (which was created by a Java program). In Python I would just use the "exec expression in expression [, expression]" to do this, however I cannot seem to be able to find the equivalent class in Java.

Does anyone know what class I need to dynamically compile and run Java code?

Thanks

#2
Exem

Exem

    Newbie

  • Members
  • PipPip
  • 12 posts
So does anyone know how to run java code generated within another java program?

#3
Exem

Exem

    Newbie

  • Members
  • PipPip
  • 12 posts
I just discovered BeanShell. I think this will work. Thanks to anyone who attempted google searches on my behalf.