-
Notifications
You must be signed in to change notification settings - Fork 3
JniGen Code Generator
Using SmJNI in your C++ code solves many problems - type safety, RAII, need to lookup classes and methods by string names etc. However, one problem still remains. For every Java entity that needs to be visible from C++ code: classes, methods, fields or native methods there is some boilerplate code to write. It's only a few lines and it closely parallels the Java code but it is tedious, repetitive and violates DRY principle. If you make a change you need to to make it twice. If you forget you'll get runtime errors. The JniGen code generator solves this issue by generating necessary boilerplate C++ code from Java automatically. It relies on Java annotations and an annotation processor.
The following pages describe how to set it up and use it.
This library is no longer actively maintained.
For an actively maintained and supported fork please migrate to SimpleJNI at https://github.com/gershnik/SimpleJNI
- Building
-
User's Guide
Declaring Java Types
Accessing Methods and Fields
Representing Java Classes
Implementing Native Methods
Smart References
Error Handling
Obtaining JNIEnv
Initialization
Strings
Arrays
Direct Buffers
Booleans
Sizes -
JniGen Code Generator
Integrating JniGen
Annotations
Processor Options