jni4net c# with java in jni4net java.lang.ClassNotFoundException -
i built small , simple helloworld program in java (has interface , in class has system.lang.out.println("hello world"))). wrapped proxy gen. i'm trying attach c# (going mecalc example) following error:
unhandled exception: net.sf.jni4net.jni.jniexception: can't load java class dt09120958.helloworld09120958 classloader sun.misc.launcher$appclassloader@c387f44 ---> java.lang.classnotfoundexception: dt09120958.helloworld09120958 @ net.sf.jni4net.jni.jnienv.exceptiontest() @ net.sf.jni4net.jni.jnienv.callobjectmethodptr(ijvmproxy obj, methodid methodidnative, value[] args) @ java.lang.classloader.loadclass(string par0) @ net.sf.jni4net.utils.registry.loadclass(string name, classloader classloader, jnienv env) --- end of inner exception stack trace --- @ net.sf.jni4net.utils.registry.loadclass(string name, classloader classloader, jnienv env) @ net.sf.jni4net.utils.registry.registerclass(registryrecord record, classloader classloader, jnienv env) @ net.sf.jni4net.utils.registry.bindjvm(registryrecord record, classloader classloader, jnienv env) @ net.sf.jni4net.utils.registry.bindjvm(registryrecord record, jnienv env) @ net.sf.jni4net.utils.registry.registertype(type type, boolean bindjvm, jnienv env) @ net.sf.jni4net.utils.registry.registerassembly(assembly assembly, boolean bindjvm) @ net.sf.jni4net.bridge.registerassembly(assembly assembly) @ netdt09120958.program.main(string[] args)
my c# code:
static void main(string[] args) { var bridgesetup = new bridgesetup(); bridgesetup.addalljarsclasspath("."); bridge.createjvm(bridgesetup); bridge.registerassembly(typeof(helloworld09120958).assembly); ihelloworld09120958 calc = new helloworld09120958(); calc.sayhello(); console.readkey(); }
why so? doing wrong , how can fix work?
found out java packages may not contain uppercase letters. original jar , j4n.jar have in same folder exe file. when adding them project make sure in properties marked "copy always" thankyou @tetsuya yamamoto
also found link might troubleshoot http://jni4net.com/troubleshoot.html
Comments
Post a Comment