Log In | Sign Up   View a printable version of the current page.
  Dashboard > [fleXive] > ... > How-Tos > Use JSR-223 Scripting Languages

Added by Markus Plesser, last edited by Daniel Lichtenberger on Aug 18, 2009  (view change)
Labels: 
(None)

Overview

When using Java 6, it is possible to use JSR-223 scripting languages like JRuby or JPython for scripting inside the repository. On Java 5, only Groovy is available.
As described in the scripting project's home page - a list of supported languages can be found at the bottom of that page - it is possible to integrate and use various scripting languages from Java.

Enabling additional scripting languages

... is easy if you know how to do it
Java needs a special jar with bootstrap information (located in META-INF/services/javax.script.ScriptEngineFactory) to register itself and the language implementation of course.

A zip-file/tarball with the bootstrap jars for all supported languages can be downloaded here.
The respective ...-engine.jar and the jar's needed by the language have to be in the classpath of the Application Server to be enabled.

Example: Adding JRuby JSR-223 support to JBoss 4.2.2

Assuming you use the default profile

  1. Download jsr223-engines.tar.gz (or jsr223-engines.zip) from here
  2. Download http://dist.codehaus.org/jruby/jruby-bin-1.0.zip (or http://dist.codehaus.org/jruby/jruby-bin-1.0.tar.gz)
  3. Unpack jsr223-engines.xxx and copy /jruby/build/jruby-engine.jar to jboss/server/default/lib
  4. Unpack jruby-bin-1.0.xxx and copy all files in the /jruby-1.0/lib directory (except bsf.jar since JBoss has its own) to jboss/server/default/lib
  5. Restart JBoss and you should be ready to use JRuby in [fleXive] as a scripting language:

Site running on a free Atlassian Confluence Open Source Project License granted to [fleXive] . Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.1 Build:#916 Nov 09, 2007) - Bug/feature request - Contact Administrators