JNIPort: Running Java from Squeak

11 June, 2010

Joachim  Geidel has published a preview release of JNIPort, a Smalltalk library which allows Java code to be invoked from Smalltalk. It acts as a bridge between the world of Smalltalk objects and a Java Virtual Machine (JVM) where Java code is executing.

The port to Pharo and Squeak is not yet finished: it lacks support for callbacks from Java to Smalltalk, and is a work in progress. Joachim is particularly interested in feedback from Squeak 4.1 users.

JNIPort was originally written by Chris Uppal for Dolphin Smalltalk and published under a liberal licence which permits its use in commercial and non-commercial software. Joachim Geidel originally ported JNIPort to VisualWorks in 2006 and is now building on that work to make it available to Pharo and Squeak. The goal is to publish a stable release for VisualWorks, Pharo and Squeak in Q3/2010.

In addition to giving Smalltalk programs access to Java libraries and services, the interactivity of Smalltalk makes it an ideal environment to experiment and prototype new Java functionality.

Once it’s installed, calling some Java can be as simple as three lines in your workspace:

jvm := JVM current.
class := jvm findClass: #’java.lang.System’.
class currentTimeMillis_null

Installation instructions documentation and much more information are on the JNIPort Wiki.

2 Responses to “JNIPort: Running Java from Squeak”

  1. Joachim Geidel Says:

    Thanks for spreading the word! But please note that JNI stands for “Java Native Interface” which is an interface offered by the Java Virtual Machine. Chris Uppal did not implement JNI. He implemented JNIPort, which uses the JNI and which I have ported to VisualWorks. I usually write “JNIPort for VisualWorks” when I mean the version for VisualWorks.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: