C function calls from Java

I am looking to create a GUI and application in java.
Some functions that I'd like to use are already written in C.
I am trying to keep this portable as it needs to function on a few different platforms.
The C libraries are also already compiled into a dll for Windows.
Is there a way to call these functions from a Java program?
(I've only written a little code in Java)



  • Hi,

    There are at least two solutions to your problems. At least I think so.
    The first is to invoke COM classes directly out of java. There are several comercial interfaces to do so... one I know is called "bridge to java" from IBM.

    The second solution is to write native methods (e.g. in C/C++) and compile them as explained at java.sun.com. Here's a link...


    Possibly you'll have to write some extra classes in c, to invoke your native code as desired (I don't exactly know, because I didn't compile native code, yet) So, just try :-D
    kind regards
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion