tags:

views:

216

answers:

2

I've been interested in doing some work on a desktop application for while now and my most proficient language is Java. Due to wanting to be able to compile down to a native executable, does anyone have any experience they would like to share about using gcj to compile, and CNI for libraries? I was hoping to use of of the native toolkits, not just Swing/SWT.

A: 

I haven't used gcj for compiling to a native executable but for interfacing to native libraries I've found JNA to be a very nice way to do it as you don't have to write any native code at all to make native calls. Note that doing it this way does result in a performance penalty so it probably wouldn't be an option if you're calling into native code in a tight loop where performance is likely to be an issue.

Yeroc
+1  A: 

As Eclipse has been sucessfully compiled natively (see http://www.linuxjournal.com/article/7413) I would say it's possible.

I used GCJ to embed Java code into an C++ application, but I would not use it for a UI application. I would go pure Java there (probably Eclipse RCP based) as that is where I have experience.

Have fun experimenting!

lothar