title: Printing Exception Message in java
body: <p>Is there a way to print an exception message in Java without the exception?</p>
  
  <p>When I try the following piece of code: </p>
  
  <pre><code>try {
      // statements
  } catch (javax.script.ScriptException ex) {
      System.out.println(ex.getMessage());
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Invalid JavaScript code: sun.org.mozilla.javascript.internal.EvaluatorException:
  missing } after property list (&lt;Unknown source&gt;) in &lt;Unknown source&gt;; 
  at line number 1
  </code></pre>
  
  <p>Is there a way to print the message without the exception information, source and line number information. In other words, the message I would like to print in the output is:</p>
  
  <pre><code>missing } after property list
  </code></pre>