Skip to content
brett hartshorn edited this page Feb 20, 2015 · 5 revisions

Calling Java from Rusthon

The JavaVM library can be linked with your output exe by using import jvm, and java classes exposed by wrapping them in XML using Giws. https://github.com/opencollab/giws/

import the jvm module and load the java packages with jvm.namespace to import those classes into this namespace.

import jvm
jvm.namespace('org.mypackage')

java objects are created by calling the jvm module.

ob = jvm(MyJavaClass())

https://github.com/rusthon/Rusthon/blob/master/examples/java_giws.md

Loading External Jar

jvm.load imports jar files into the JVM. Example that shows how to load Jython into Rusthon. https://github.com/rusthon/Rusthon/blob/master/examples/giws_jython.md

jvm.load("jython.jar")

Sidebar

Clone this wiki locally