Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing JNI applications with Eclipse (Combined Java/C++)

Have anyone successfully managed to setup a combined Java/C++ project for Eclipse?

What I am trying to do is quite simple;

1) Compile my Java sources
2) Run Javah to create the JNI interface
3) Compile all the C/C++ sources
4) Link native shared library + package the JAR

Hints or even real projects which work are much welcome.

(Eclipse 3.5)

like image 810
ointment Avatar asked Oct 26 '09 11:10

ointment


People also ask

How do I use JNI as a bridge between Java and C++?

The first thing you do is declare a native function inside your Java class with appropriate Request and Responses. Next, inside your Java class, you load a System library (a . so file or a . dll file) that includes the implementation of this native function in C++.

What is JNA vs JNI?

Java Native Access (JNA) is a community-developed library that provides Java programs easy access to native shared libraries without using the Java Native Interface (JNI). JNA's design aims to provide native access in a natural way with a minimum of effort. Unlike JNI, no boilerplate or generated glue code is required.

What is Jclass in JNI?

typedef jobject jclass; In C++, JNI introduces a set of dummy classes to enforce the subtyping relationship. For example: class _jobject {}; class _jclass : public _jobject {}; ...


1 Answers

http://www.cs.umanitoba.ca/~eclipse/8-JNI.pdf I think this is what you wanted.Maybe a little old.

like image 187
dape Avatar answered Oct 15 '22 07:10

dape