[kepler-dev] JNI under Windows

Dan Higgins higgins at nceas.ucsb.edu
Sun Jun 11 12:33:54 PDT 2006

    Kepler does use JNI for several actors (but not for our R based 
actors!). JNI is used for the 'GARP' actors and the gdal gis actor. We 
have not had any particular problem with the JNI interface, but note 
that we are not running under cygwin for these jni-based actors. 
Instead, they were compiled under Microsoft Visual C. I didn't do the 
original programming, but I am under the impression that the original 
programmers were unable to get JNI working on Windows with cygwin/gcc, 
but that it was straightforward with the MS compiler. The main problem 
now is getting platform specific code running on Windows, Mac OS X, and 
Linux. (The new Intel-based Macs has added some complexities to the 


Christopher Brooks wrote:
> Ok, I got around to trying the Java Launcher for JNI
> programs that was described in
> http://elliotth.blogspot.com/2005/08/porting-jni-code-to-win32-with-cygwin.html
> I downloaded some C code from
> http://software.jessies.org/terminator/
> checked it in to ptII/jni/launcher and after a little cleaning, I
> was able to run the meaningOfLife demo under Windows.
> The launcher program is a C program that invokes
> Java that then allows Java to invoke JNI programs
> under Cygwin.  Without this launcher program, under Windows
> with Cygwin, any Ptolemy model that uses the JNI actors or
> the Ptolemy Matlab actor exits violently.
> The launcher program takes an argument that names the 
> class with a slash separated name.  Also, thee class path
> must be passed in as a property.
> For example, to run "vergil -jni", we do:
> $PTII/jni/launcher/launcher -Djava.class.path="$PTII" ptolemy/vergil/VergilApplication -jni
> The launcher can be used to solve the problems we were
> having with Viptos under Windows.
> Also, it should help with the Matlab interface.
> One side effect is that since we now need a custom launcher for the
> Matlab actor, the InstallAnywhere LaunchAnywhere binary is probably
> not going to cut it for us. This means will need a new installer.  If
> we don't need the Matlab actor, then InstallAnywhere can still be
> used.
> Interestingly, Kepler uses JNI in a few places, most notably with R.
> I'm surprised that there have not been problems like what we've had
> with simple JNI actors and with the Matlab actor.  More research 
> is in order, I'd like to be sure that we understand this.
> More cleanup of the launcher code is in order.  I need to look
> at the copyright etc.
> Also, the Ptolemy JNI UI is a mess, it would be worth fixing this
> because I keep getting questions about it.  Removing it from the tree
> is an option, but the problem is that then people download Ptolemy II
> 4.0 and ask questions about it, which is basically unsupportable since
> I'm always saying, "Upgrade".
> _Christopher
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev

More information about the Kepler-dev mailing list