HP3000-L Archives

October 2002, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mike Yawn <[log in to unmask]>
Reply To:
Mike Yawn <[log in to unmask]>
Date:
Tue, 29 Oct 2002 10:01:58 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (46 lines)
For any non-Java program to invoke Java code, it must create a
JVM for the code to execute in.  The Java Native Interface (JNI)
has a set of APIs known as the invocation interface which provide
this capability.

The invocation interface is only designed to be called from C/C++.
I suspect a sufficiently clever COBOL programmer could manage to
get all of the structures built properly for the call to work,
but I haven't done it personally.

I've written a couple of things that use the invocation interface;
the VPLUS class library was one of them.  I also played with it in
the JavaCI implementation, but can't recall offhand if the final
released version used the invocation interface or not.

To the best of my knowledge, nobody has done this from COBOL --
I think very few people have even used the invocation interface
from C/C++ (going the other direction - Java calling native code -
is simpler and more common.  The MPE Class Library for Java allows
invocation of non-C/C++ code from within Java simply by defining
the target procedure's location and parameters).

If something to invoke Java from COBOL were created, it would make
a nice addition or complement to the MPE Class Library.  If I can
help with the effort, I'd be happy to as time permits.

Mike


BIXBY,MARK (HP-Cupertino,ex1) wrote:
> Hi HP3000-L,
>
> What is the easiest (or the best) way for an MPE COBOL program to call Java
> code?
>
> COBOL code samples would be greatly appreciated.  Thanks!!!
>
> - Mark B.
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2