[java] java native interface

Started by
3 comments, last by sysmark 22 years, 7 months ago
I want to use the invocation API so that I can use java classes in my C++ programs. I know I have to use the javai.lib and .dll files, but they are not installed with my Java SDK (v 1.3.1, I have the jumpstart edition that Sun gave away for free). So my question is: what do I have to install so I can use the native interface?
Advertisement
I don''t know what the jumpstart edition is, but the Java 2 SDK is freely downloadable from java.sun.com. When installing, select the "Install JNI headers and libs" (something like that) option and you should get everything you need to use the JNI.
The jumpstart edition is just all the java stuff on cd''s (4 of em). Normally they would cost $20, but Sun gave them away for free some time ago. But after spitting through the documentation for about 2 hours I found the solution: the native interface is only part of the 1.1 SDK....
Hi!

Sysmark; the native interface is part of Java 1.1. But Java Native Interface (JNI) is part of Java 2, ie version 1.2 or later. If you have a Java 2 version you get prompted if you want to use the old or new style of native interface. I suggest you use the new version. After installation everything is included to start coding with JNI. It´s as simple as that!

Then you have to use the javah tool and implement your C/C++ code. But´s thats another story.

Regards
Johan
Johan Karlsson
I''m sorry, but I did not see that popup while installing. The only popup that I got was the one asking me what components I wanted to install (I choose all), and then it informed me it was installing the runtime environment. That''s it! I''ll download the latest SDK and try it again though. Anyway, thanks for answering.

This topic is closed to new replies.

Advertisement