C++ to java bridge

Discussion in 'Java' started by dao, May 19, 2008.

  1. dao

    dao Guest

    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
     
    dao, May 19, 2008
    #1
    1. Advertising

  2. dao

    Arne Vajhøj Guest

    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
     
    Arne Vajhøj, May 20, 2008
    #2
    1. Advertising

  3. dao

    dao Guest

    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 <> 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
     
    dao, May 20, 2008
    #3
  4. dao

    Arne Vajhøj Guest

    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
     
    Arne Vajhøj, May 26, 2008
    #4
  5. dao

    dao Guest

    On 26 mai, 05:18, Arne Vajhøj <> 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...
     
    dao, May 26, 2008
    #5
  6. dao

    Tom Anderson Guest

    On Mon, 26 May 2008, dao wrote:

    > On 26 mai, 05:18, Arne Vajhøj <> 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
     
    Tom Anderson, May 26, 2008
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abraham Khalil

    Java object in VB - ActiveX Bridge

    Abraham Khalil, Feb 9, 2004, in forum: Java
    Replies:
    0
    Views:
    540
    Abraham Khalil
    Feb 9, 2004
  2. Jeff Gaynor
    Replies:
    0
    Views:
    352
    Jeff Gaynor
    May 19, 2004
  3. Replies:
    8
    Views:
    603
    Cindi
    Jan 8, 2005
  4. Replies:
    1
    Views:
    4,508
    Kim Hansen
    Oct 8, 2009
  5. Khamis Abuelkomboz

    COM Bridge for Java?

    Khamis Abuelkomboz, Jan 24, 2006, in forum: Java
    Replies:
    2
    Views:
    465
    Roedy Green
    Jan 25, 2006
Loading...

Share This Page