• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling java from PL1  RSS feed

 
Wim Praet
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

does anyone here know if you are able to call a Java methods/programe from within a PL1 program?

I have googled the net but did not find anything suitable. There do exist PL1 to Java converters though, but that is not what I am looking for.

Either a PL1 program should call a java method/application (or the other way round, but that is less preferable for me). I did not find any API or layer to do this thus far.
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at Java JNI technology.


Though most Java developers think of the Java Native Interface (JNI) as a framework for developing native libraries that can be called from Java, relatively few know that JNI also supports communication in the reverse direction: it provides native programs written in C with the ability to call Java objects.
 
Wim Praet
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did find some information on how a java program should call native methods with their implementation in PL/I (using JNI, see http://publib.boulder.ibm.com/infocenter/pdthelp/index.jsp?topic=/com.ibm.entpli3.doc/ibma1mst313.htm).

But this seems to work only when the java program initiates the call through the native method first, upon which the PL/I subroutine can use the calling object (and it's fields and methods).

I am wondering if it is possible to use java classes from PL/I, without the need of the java class first calling the native method. According to the book "Das neue PL/I" (in German only I'm afraid, http://www.uni-muenster.de/ZIV/Mitarbeiter/EberhardSturm/pl1buch.html) a PL/I program should be able to start a JVM and use any of the available java classes of the JDK (and the ones you provide?).
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Honestly I never used JNI. On one project they needed to call Java from C++ and they told me it can be done using JNI. This is where my knowledge ends. If I were you I'd google "C call Java" or something since there are not so many PL1 programmers. I think if you can call C or C++ from PL1 then you should be able to call Java too.

Good luck!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!