I'm trying to evaluate a string in Java, using the following code from another answer on the newsgroup.
import java.lang.Object;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
ScriptEngineManager m = new ScriptEngineManager();
ScriptEngine e = m.getEngineByName("js");
Object result = e.eval("13+23-3");
However, I get an "unreported exception javax.script.ScriptException; myst be caught or declared to be thrown" .. error at compile time. As I am still learning and unfamiliar with exception handling to a great extent, can someone please help me out?
Thanks.