C++ to java bridge

D

dao

hello,

I am challenging different solutions to bridge some JAVA code with
existing C++ code.

As JNI seems to be very difficult to handle, I did a little search
about automatic bridging. I found 3 interesting solutions:

*gluegen
*SWIG
*noodleglue

But no piece of advice concerning the "one to use".

Does someone have some feedback concerning the performance and
reliability of those solutions? A comparisoN?

thank's
 
A

Arne Vajhøj

maaxiim said:
There is another option that you might be interested in; RJCB/DTJCB. It
is an IBM supported Java/COM bridge. It is not directly Java/C++, but if
your C++ code exposes a COM interface, it might be a more performant
solution.

And if the C++ code is not COM code, then using JNI will be much easier
that making the C++ COM.

:)

Arne
 
D

dao

Unfortunately, I am not using a com object (either dll or sl/so
libraries in unix)

An the different solution I want an evaluation are compilers that
generates java code implementing JNI.

JNI is very complicated to use. I want an automatic bridge compiler
between C++ and java
 
A

Arne Vajhøj

dao said:
Unfortunately, I am not using a com object (either dll or sl/so
libraries in unix)

An the different solution I want an evaluation are compilers that
generates java code implementing JNI.

JNI is very complicated to use. I want an automatic bridge compiler
between C++ and java

What do the exactly expect ?

A program that can take a .h file and generate:
- .java with class and native methods
- JNI .h
- JNI .c with delegation to the real functions
?

Arne
 
D

dao

What do the exactly expect ?

A program that can take a .h file and generate:
- .java with class and native methods
- JNI .h
- JNI .c with delegation to the real functions
?

Arne

I want a solution that creates a jar (or .java) from:

* .h
* .so, .sl or .dll

I suppose I am not the first to have those requirements...
 
T

Tom Anderson

I want a solution that creates a jar (or .java) from:

* .h
* .so, .sl or .dll

I suppose I am not the first to have those requirements...

http://www.swig.org/

It's not quite .h-to-.java - you have to write a simple interface file,
but that's pretty much trivial, and if your C code isn't complicated,
boils down to five lines for any amount of C.

Also, there are limits on what you can do. If the code on the C side
stashes a pointer you pass it between invocations, i think you're in
trouble. Real JNI is the only way to deal with this.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top