Howdy, Stranger!

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

Categories

C function calls from Java

jakewendtjakewendt Member Posts: 18
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)

TIA


Comments

  • moomoo Member Posts: 147
    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...

    [code]
    http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html
    [/code]

    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
    moo
  • Justin BibJustin Bib USAMember Posts: 0

    _________ < http://forcoder.org /> free ebooks and video tutorials about ( Objective-C, C#, Go, PL/SQL, Delphi, R, C++, Visual Basic .NET, Swift, JavaScript, Python, MATLAB, Perl, Assembly, PHP, Visual Basic, Ruby, Scratch, Java, C Clojure, ML, Dart, Julia, VBScript, Bash, Scheme, Transact-SQL, Ada, Logo, D, Lua, LabVIEW, Kotlin, Apex, Prolog, Rust, Hack, Alice, Erlang, Crystal, COBOL, ABAP, Awk, Fortran, Lisp, F#, SAS, FoxPro, Scala ) _____

Sign In or Register to comment.