2

Disclaimer: I know that Python's eval() represents the possibility of a security breach and that exec() is rarely used. But I really need them in my project.

Are there equivalents to them in Java? Is it possible to evaluate expressions and execute Java code from String objects?

EDIT: This question is different from the one proposed because I also want an exec() (Which means that I want to execute general Java code from Strings objects, not just mere expressions).

Ericson Willians
  • 7,606
  • 11
  • 63
  • 114
  • Java isn't a scripting language, but there are scripting languages that run on the JVM. Inlcuding jython (which is python in Java). Also, there is `ScriptEngine` (which include JavaScript). – Elliott Frisch May 29 '15 at 02:30
  • *"This question is different from the one proposed because I also want an exec() (Which means that I want to execute general Java code from Strings objects, not just mere expressions)"* - Then the answer is no – MadProgrammer May 29 '15 at 02:32

0 Answers0