Java to C++ - Automatic Migration

Started by
11 comments, last by ResearchMonkey 18 years, 10 months ago
Quote:Original post by snk_kid
Quote:Original post by Andrew Russell
Interesting Question: Can the GNU Java compiler compile to object files or static libraries that can then be used by the GNU C++ compiler?

Sure CNI


Awesome, I'll have to remember that.

Then of course, this is probably the simplest and most effective method for ResearchMonkey's problem.
Advertisement
Quote:Original post by Andrew Russell
Then of course, this is probably the simplest and most effective method for ResearchMonkey's problem.


Its quite simple to do, you can compile java directly to native, automatically generate binding C++ headers from java code etc, however bare in mind that (last time i checked) GCJ's imp of the the java class libraries isn't 100% complete (most of it but not all). Also CNI is GCC only (it can do JNI but its not as nice as CNI) .
Having done a bit more research today in conjunction with some colleagues we've discovered java2cpp from Programics (http://www.programics.com/java2cpp.php). I've been playing around with it for a few hours and it looks like it should fit the bill very well. It translates Java to pretty readable C++ and, on the simple examples I've thrown at it, performs very well.

Still plenty of work to do on this project but at least I have a jumping off point and several thousand less lines of unfinished Java code to worry about.

Cheers,
RM

This topic is closed to new replies.

Advertisement