Looking for a convenient way to call Java from C++

Yes, there are existing tools that do exactly this — generate C++ wrappers for Java classes. This makes use of Java APIs in C++ more transparent and enjoyable, with lower cost and risk.

The one that I’ve used the most is JunC++ion. It’s mature, powerful and stable. The primary author is very nice, and very responsive. Unfortunately, it’s a commercial product, and pricey.

Jace is a free, open-source tool with a BSD license. It’s been years since I last played with jace. Looks like there’s still some active development. (I still remember the USENET post by the original author, over a decade ago, asking basically the same question you’re asking.)

If you need to support callbacks from Java to C++, it’s helpful to define C++ classes that implement Java interfaces. At least JunC++ion allows you to pass such C++ classes to Java methods that take callbacks. The last time I tried jace, it did not support this — but that was seven years ago.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)