title: Evaluate math expression but given variables instead of numbers
body: <p>There are lot of math expression evaluators out there, but they evaluate something like (1 + 2)/3, and so on. But I need to evaluate expression which contains variables (in java). For example, if the program has two variables <code>int a = 1; int b = 2;</code> and if I pass something like <code>(a + b)/a</code> to a method as a <code>String</code>, it should return the result as 3 which is actually (1+2)/1. Actually the formula/expression comes from a config file.</p>
  
  <p>Edit: Just found a similar question <a href="https://stackoverflow.com/questions/7515397/evaluating-math-expression-on-dictionary-variables">Evaluating math expression on dictionary variables</a> , but need the solution in java</p>