epubjs
Version:
Render ePub documents in the browser, across many devices
25 lines (24 loc) • 2.48 kB
HTML
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix B. BeanShell: Java Scripting</title><link rel="stylesheet" href="core.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"/></head><body><div class="appendix" title="Appendix B. BeanShell: Java Scripting"><div class="titlepage"><div><div><h1 class="title"><a id="learnjava3-APP-B"/>Appendix B. BeanShell: Java Scripting</h1></div></div></div><p>In this book, we (in this case, I, Pat) have avoided talking about
many third-party tools that aren’t part of the standard JDK. I’m going to
make an exception here to give a shout out to a nifty, free Java tool called
BeanShell. As its name suggests, BeanShell can be used as a Java “shell.” It
allows you to type standard Java syntax—statements, expressions, and even
classes—on the command line or evaluate bits of source code from within your
applications. With BeanShell, you can try out bits of code as you work
through the book. You can access all Java APIs and even create graphical
user interface components and manipulate them “live.” BeanShell uses only
reflection, so there is no need to compile class files.</p><p><a id="I_indexterm_id838756" class="indexterm"/>I wrote BeanShell while developing the examples for this book,
and I think it makes a fun companion to have along on your journey through
Java. BeanShell is an open source software project and at the time of this writing is
in the process of being adopted by the Apache foundation. You can find the
latest updates and more information at its <a class="ulink" href="http://www.beanshell.org">current home</a>. Over the years,
BeanShell has been a popular tool and has been widely used in tools and
projects that require scripting. However, today there are probably better
options for serious scripting integration with Java. For example, you may
wish to look at Jython, an implementation of the Python scripting language,
as another option. Many scripting languages can be accessed in a plug-in/
provider fashion using the <a id="I_indexterm_id838780" class="indexterm"/><code class="literal">java.scripting</code> API
(JSR-223). The JDK 7 is bundled with the Mozilla Rhino implementation of
JavaScript, as another option.</p></div></body></html>