jnipp
jnipp copied to clipboard
Support for loading custom jars/classes and/or setting additional JVM options
Hey guys, great project! I've noticed that there is no option to load a custom jar, because JavaVMInitArgs is hidden [1] from the public access. AFAIK, to load a custom jar/class from JNI, it neads to set JavaVMOption. Something like this (not tested):
JavaVMInitArgs args;
JavaVMOption options[1];
options[0].optionString = "-Djava.class.path=path/to/lib1.jar;path/to/lib2.jar"
args.options=options;
args.nOptions=1;
Maybe a version of Vm constructor with JavaVMOption migth do the trick? Like:
Vm::Vm(const char *path, JavaVMOption *opts = nullptr) { ... }
[1] https://github.com/mitchdowd/jnipp/blob/master/jnipp.cpp#L1462
really needed