0

Is there any way that I can execute arbitrary Java code from a String like Sql.exect(String). Is there something like Java.exect(String). Can anyone point me to a command or simple tutorial?

Ryan Ransford
  • 3,224
  • 28
  • 35

2 Answers2

1

You can use Janino, take a look at here;

http://docs.codehaus.org/display/JANINO/Home

Onur A.
  • 3,007
  • 3
  • 22
  • 37
1

I'm not sure if I understood you correctly, but maybe try to dig about this Java 6 Compiler API

Seraphis
  • 1,026
  • 2
  • 14
  • 30
  • does this work in android well for example i want String s = "int y = 3+6;" then something like Run(x) – Mohammad Rababah Jul 09 '14 at 13:01
  • Ok, It's not for Android. For that check this answer: http://stackoverflow.com/questions/17538537/compiling-string-as-code-during-runtime-on-android – Seraphis Jul 09 '14 at 13:14