You could also use my Nashorn library
define a js function like
function evaluate(a,b){
return new java.lang[b](eval(a))
}
This also allows you to specify the data type for the return
so you call it by
script.invoke("evaluate",Array("Math.sqrt(12*(14-6)/7)","Float"))
And in this case it will return a float value.
(You can use Double,Float,Integer,String etc)