NMI allows Java programs and Native programs to interact
(i.e. call each other's methods and pass parameters back and forth), but
its current API expects Native programs to be in C or C++. One way to
expand the limitations of NMI is to use exec method of the Runtime class,which allow you to run external programs from your Java application.
The instance of Process class returned by exec allows you to communicate
with the external program (i.e. send and receive data via input and output stream).
Example:
Java Code: syscall.java
Perl Code: hello.pl
Programs are in /afs/cs.unc.edu/project/courses/190-25s98/members/yang/java.