• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java GUI calling C++ dll and shared lib

 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What would be the best way to call a dll (on windows) or a shared library (on unix) from a java gui program.

We want to port a program which has calculation functions written in C++ and a small GUI in Delphi to other operating systems. One of the options would be, rewrite the GUI in Java, and let java call the native C++ code.

I was thinking of JNI, but I do not know if there are other options. I know that we also could use other tools like Qt, Mono and Lazarus, but that's not my task. I am investigating in Java is an options.

Thanks in advance for any advice.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since it's a library and not a whole program, JNI (or JNA which basically is JNI but then written in Java) is the only way I think.

Either that, or write the GUI in C(++). Qt can be used, but GTK+ (with gtkmm being the C++ version) is also quite good.
 
reply
    Bookmark Topic Watch Topic
  • New Topic