Operating System - OpenVMS
1753667 Members
6103 Online
108799 Solutions
New Discussion юеВ

Re: JNI - OpenVMS Sharable Image

 
S Dawson
New Member

JNI - OpenVMS Sharable Image

I'm trying to incorporate some Java code into an existing Legacy 'C' application. I have modified the Java JNI demo (that came with the OpenVMS SDK) to the point where I have the Java code performing the functionality I need.

My question is:
Does the System.loadLibrary have to point to an executable image, can I just point it at the .obj, or??? I've tried several options, and checked several forums, but have not seen where this is done. And I have not got anything to work yet.

Something tells me there's got to be a better way to integrate existing apps with a Java module than having to do a loadLibrary on the large executable for 1 'C' entry point.

If someone could point me in the right direction, I'd appreciate it.

Thanks.
3 REPLIES 3
Robert Gezelter
Honored Contributor

Re: JNI - OpenVMS Sharable Image

S Dawson,

It needs to point to a correct built shareable library image (been there, done that--my project involved C code native methods invoked by Java programs).

- Bob Gezelter, http://www.rlgsc.com
S Dawson
New Member

Re: JNI - OpenVMS Sharable Image

I'm trying to stick some EJB's into an existing 'C' legacy application. This seems a cleaner approach than using sockets to segregate the C exe's from Java processes.

I have the same executable running in 3 seperate groups (ie. environments). Each group has it's own group level logicals, UIC, ....
The JNI stuff is not giving me as much problems as the OpenVMS is.

Does this approach make sense?
Has anyone done more than a trivial integration of Java into 'C'...This is really bugging me because I could brute force it with just socket calls into a pure Java environment in about half the time....but the idea of creating a 'C' cover function that Creates the JVM and calls existing Java code is just too much to give up on without somewhat of a fight.

Any suggestions would be helpful.

Scott
Volker Halle
Honored Contributor

Re: JNI - OpenVMS Sharable Image

Scott,

not being a JAVA nor C programmer, but there was a recent question on how to create a JAVA VM from BASIC:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=999642

There is also an ATW example on calling COBOL from JAVA (JNI):

http://h71000.www7.hp.com/wizard/wiz_7543.html

Volker.