NetBeans ScriptEngine - update

I've just updated the my NetBeans Script module (see blog). Here is a list of the new features
  1. The script related menu items have its own menu call 'Scripts' in the main toolbar
  2. A script environment view which lets you look at what are the script modules and script engines that are installed
  3. A simple file system view of the script repository directory. Can you do most things like create and delete scripts and directory. However you cannot drag and drop files/directorys. Did not want to turn this into a full fledge file management thingy. The update view is not very optimized. Every time you add or delete a file, the entire view is reloaded.
  4. I've added a simple script console. For every script engine, you can now open a script console in NetBeans. Furthermore every console opened will have an object call Console that allows you to manipulate the console. JavaScript console will be the best support. The JS console is initialized with init.js from Mustang as well as a few additional functions. You can add console initialization scripts (aka .profile) in console directory. The name of this initialization script has to called globals.<script suffix>.
  5. I've added documentation to on the new features, programming objects, etc. It's probably not enough but will have to do for the time being. Go to Help -> Help Contents -> ScriptEngine entry
Here is a screenshot of the new features

Click to enlarge
You can get the latest NBM here and here. I've also change the license from CDDL to BSD.  If you are going to try the script module, here are the requirements
  1. NetBeans must be running on Mustang viz. use the --jdkhome when you  start NB
  2. I've tested the module on b82 onwards
  3. You must update NetBeans to use the beta version of Matisse.


Really nice, I like the idea of the integrated console, but having difficulty with getting this to work with jython (my favorite). I can look into it myself, but I cannot find the link to your actual sources. How about getting it uploaded to ;-)

Posted by Sven Reimers on July 18, 2006 at 07:15 AM SGT #

Sven, you must use a scripting language that is JSR-223 compliant. Jython has a JSR-223 compliant engine in Add that into the ScriptEngine and you should be able to get your console. BTW, the module is also on the scripting site mentioned above. Thanks for trying out the module.

Posted by Lee Chuk Munn on July 19, 2006 at 12:44 AM SGT #

Yeah I know, I got the ScriptEngine but get a failure that the init of the interpreter was not called: jy> print hallo Traceback (innermost last): (no code object) at line 0 java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at java.lang.Class.newInstance0( at java.lang.Class.newInstance( at org.python.core.BytecodeLoader.makeCode( at org.python.core.Py.compile_flags( at org.python.core.Py.compile_flags( at org.python.core.Py.compile_flags( at org.python.core.__builtin__.compile( at com.sun.script.jython.JythonScriptEngine.compileScript( at com.sun.script.jython.JythonScriptEngine.eval( at javax.script.AbstractScriptEngine.eval( at org.chuk.lee.scriptengine.console.CommandProcessorBase.executeCommand( at org.chuk.lee.scriptengine.console.ScriptShellPanel.executeCommand( at org.chuk.lee.scriptengine.console.ScriptShellPanel.access$600( at org.chuk.lee.scriptengine.console.ScriptShellPanel$1.insertUpdate( at javax.swing.text.AbstractDocument.fireInsertUpdate( at javax.swing.text.AbstractDocument.handleInsertString( at javax.swing.text.AbstractDocument.insertString( at javax.swing.text.PlainDocument.insertString( at org.chuk.lee.scriptengine.console.EditableAtEndDocument.insertString( at javax.swing.text.AbstractDocument.replace( at javax.swing.text.JTextComponent.replaceSelection( at javax.swing.text.DefaultEditorKit$InsertBreakAction.actionPerformed( at javax.swing.plaf.basic.BasicTextUI$TextActionWrapper.actionPerformed( at javax.swing.SwingUtilities.notifyAction( at javax.swing.JComponent.processKeyBinding( at javax.swing.JComponent.processKeyBindings( at javax.swing.JComponent.processKeyEvent( at java.awt.Component.processEvent( at java.awt.Container.processEvent( at java.awt.Component.dispatchEventImpl( at java.awt.Container.dispatchEventImpl( at java.awt.Component.dispatchEvent( at java.awt.KeyboardFocusManager.redispatchEvent( at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent( at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent( at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions( at java.awt.DefaultKeyboardFocusManager.dispatchEvent( at java.awt.Component.dispatchEventImpl( at java.awt.Container.dispatchEventImpl( at java.awt.Window.dispatchEventImpl( at java.awt.Component.dispatchEvent( at java.awt.EventQueue.dispatchEvent( at java.awt.EventDispatchThread.pumpOneEventForFilters( at java.awt.EventDispatchThread.pumpEventsForFilter( at java.awt.EventDispatchThread.pumpEventsForHierarchy( at java.awt.EventDispatchThread.pumpEvents( at java.awt.EventDispatchThread.pumpEvents( at Caused by: java.lang.IllegalStateException: Jython interpreter state not initialized. You need to call PySystemState.initialize or PythonInterpreter.initialize. at org.python.core.InternalTables.createInternalTables( at org.python.core.PyJavaClass.lookup( at org.python.core.PyObject.<init>( at org.python.core.PySequence.<init>( at org.python.core.PyString.<init>( at org.python.core.Py.newString( at org.python.pycode._pyx0.<clinit>(<unknown>) ... 52 more java.lang.ExceptionInInitializerError: java.lang.ExceptionInInitializerError Jython is a bit trickier to deal with (I wrote a console for NetBeans at the company I work for) so I may get it right if I can get the sources from you ... P.S. Still looking for actual sources ;-)

Posted by Sven Reimers on July 19, 2006 at 08:48 AM SGT #

Sven, The source are at Can you try the jython engine with jrunscript to see if it works first. My console is basically a relica (aka copy) of that. Let me know if you manage to fix it. Thanks for trying again.

Posted by Lee Chuk Munn on July 20, 2006 at 04:59 AM SGT #

Have you asked if the folks at or would post your plug-in / module ? I think it would be a nice addition :-)

Posted by charlie hunt on July 23, 2006 at 01:31 PM SGT #

Post a Comment:
Comments are closed for this entry.

Random thought at random intervals


« July 2016