JRuby

Version 1 by dnourie
on Jun 30, 2008 16:36.

compared with
Current by dnourie
on Jun 30, 2008 16:37.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View page history
Code Example 1 shows how to use the require keyword to reference or include both third-party and Java platform API libraries.
{noformat}
#Load Java platform and third-party API support using
#JRuby 0.9.1 and later syntax.
require 'java'
require 'xml-apis-1.3.02.jar'

#Third-party code
...
org.w3c.dom.Element root = g.getRoot()
svgdocument = impl.createDocument(svgNS, "svg", null)
org.w3c.dom.Node node = svgdocument.importNode(root, true)
...
{noformat}

This code sample is from the article [JRuby and the Java Platform|http://java.sun.com/developer/technicalArticles/scripting/jruby/].
* [How to use the require keyword]

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact