Over a million developers have joined DZone.

BeanShell Scripting with NetBeans IDE 7.1

· Java Zone

Learn more about how the Java language, tools and frameworks have been the foundation of countless enterprise systems, brought to you in partnership with Salesforce.

For NetBeans IDE 7.1, there is a community contributed plugin available in the Update Center that adds support for the BeanShell scripting language.

BeanShell (http://www.beanshell.org/) is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. It has been developed by Pat Niemeyer and released as (JSR-274).

BeanShell dynamically executes standard Java syntax and extends it with common scripting conveniences such as loose types, commands, and method closures like those in Perl and JavaScript.



The BeanShell plugin for NetBeans integrates seamlessly into the IDE. Within a usual Java SE project, you'll find a new BeanShell script filetype in the "New File" dialog. These files with a .bsh extension contain the scripts. BeanShell scripting uses default Java syntax, so you could write some lines of test code right away. The scripting features of BeanShell script make it quite fun to use and to experiment with.

Syntaxhighlighting and Navigator integration

One really useful feature of the plugin is the interactive scripting console. The fact that BeanShell and Java share the same syntax makes it possible to execute snippets of Java code in the scripting console. This comes in handy if you, e.g., just want to check some small piece of code and don't want to setup a test application or a JUnit test for that. You can find the scripting console window at Window/Other/BeanShell:

Interactive console

Discover how the Force.com Web Services Connector (WSC) is a code-generation tool and runtime library for use with Force.com Web services, brought to you in partnership with Salesforce.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}