Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > C++ to java bridge

Reply
Thread Tools

C++ to java bridge

 
 
dao
Guest
Posts: n/a
 
      05-19-2008
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
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      05-20-2008
maaxiim wrote:
> 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
 
Reply With Quote
 
 
 
 
dao
Guest
Posts: n/a
 
      05-20-2008
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


On 20 mai, 04:36, Arne Vajh°j <(E-Mail Removed)> wrote:
> maaxiim wrote:
> > 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


 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      05-26-2008
dao wrote:
> 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

 
Reply With Quote
 
dao
Guest
Posts: n/a
 
      05-26-2008
On 26 mai, 05:18, Arne Vajh°j <(E-Mail Removed)> wrote:
> dao wrote:
> > 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


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...
 
Reply With Quote
 
Tom Anderson
Guest
Posts: n/a
 
      05-26-2008
On Mon, 26 May 2008, dao wrote:

> On 26 mai, 05:18, Arne Vajh°j <(E-Mail Removed)> wrote:
>> dao wrote:
>>> 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

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

--
And dear lord, its like peaches in a lacy napkin. -- James Dearden
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bridge/workgroup bridge scenario and channels Chris_D Cisco 6 08-05-2005 07:46 AM
Java-COM bridge the other way? aaronfude@gmail.com Java 8 01-08-2005 03:03 PM
Looking for a few folks to test/discuss/design... a Java to OS/2 bridge. Jeff Gaynor Java 0 05-19-2004 04:02 PM
Java object in VB - ActiveX Bridge Abraham Khalil Java 0 02-09-2004 11:29 AM



Advertisments