Any framework that can make native method calls from java code easier?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dipankar_datta
Posted On:   Wednesday, May 4, 2005 02:08 PM

HI, I am working on a project which have huge codebase in C++/C and I am trying to call native library methods from java code through JNI. I am basically a J2EE guy & reletively new to JNI with lesser knowledge of C++. I found JNI very complex & especially datatype matching between java & C++ annoying (My native code is using a lot of STLs). Is there any framework available which can hide JNI complexities at least upto some extent? I was thinking of something like jace which makes calling java methods from native code easier. What I want is just the reverse of that i.e. given a native library the tool/framework should generate corresponding java proxy.    More>>


HI,

I am working on a project which have huge codebase in C++/C and I am trying to call native library methods from java code through JNI.


I am basically a J2EE guy & reletively new to JNI with lesser knowledge of C++. I found JNI very complex & especially datatype matching between java & C++ annoying (My native code is using a lot of STLs).



Is there any framework available which can hide JNI complexities at least upto some extent? I was thinking of something like jace which makes calling java methods from native code easier. What I want is just the reverse of that i.e. given a native library the tool/framework should generate corresponding java proxy.

   <<Less

Re: Any framework that can make native method calls from java code easier?

Posted By:   shiladitya_sircar  
Posted On:   Thursday, May 5, 2005 10:03 AM

Well basically what you need is java-com wrapper. The way to go about this is use JACOB. JACOM is a java com bridge which hides all complexities of com JNI calls through java. You can visit http://danadler.com/jacob/ for more information on the details. Version 1.9 has been released and can be found from sourceforge.

So basically your development steps should be as follows:
1. Download JACOB
2. put the Jacob.dll in your JRE/bin directory
3. Set the class path to point at Jacob.jar
4. Download JACOBGEN (a tool which will create the java stubs for a given DLL)
You are ready to start developing your application now in java utilizing com libraries or any other C++ libraries.

Cheers
ssircar
About | Sitemap | Contact