Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 22nd, 2011  |  syntax: Java  |  size: 0.44 KB  |  views: 88  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import javax.script.ScriptEngine;
  2. import javax.script.ScriptEngineManager;
  3. import javax.script.ScriptException;
  4.  
  5. public class hi
  6. {
  7.   public static void main(String[] args)
  8.   {
  9.     ScriptEngineManager factory = new ScriptEngineManager();
  10.  
  11.     ScriptEngine engine = factory.getEngineByName("JavaScript");
  12.     try
  13.     {
  14.       engine.eval("print(\"hello\")");
  15.     }
  16.     catch (ScriptException e) {
  17.       e.printStackTrace();
  18.     }
  19.   }
  20. }