title: Java ScriptEngine - Create dynamic variables in java class
body: <p>I've using the java ScriptEngine to execute a script that could alter a shared Java class. I'm wondering, if it's possible to support dynamically created variables in the java class?</p>
  
  <pre><code>// create a script engine manager
  ScriptEngineManager factory = new ScriptEngineManager();
  
  // create a JavaScript engine
  ScriptEngine engine = factory.getEngineByName("JavaScript"); 
  engine.put("javaclass", jClass);
  
  engine.eval("javaclass.propertyThatDoesNotExist = 'test'"); // throws exception
  </code></pre>