HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

JNI - OpenVMS Sharable Image

 
S Dawson
Occasional Visitor

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
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
Occasional Visitor

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.