As a C++ developer, I occasionally come across Java libraries like iText, Batik, JasperReports, and JFreeChart. In each case, equivalent cross-platform C++ libraries seem to be much less mature, much more expensive, or unavailable.
Is it practical to use these Java libraries from my C++ app for reporting, charting, and similar? If so, what's the best approach to doing so?
- Use JNI to embed a JVM within my application?
- Use GCJ to compile the Java libraries to native code?
- Some other integration method that I'm not aware of?
- Give up, since calling a Java library from C++ would be too hard to be practical, and instead invest my efforts in finding C++ libraries?