Why does the first example work, but the second one doesn't?
HI,
slight problem that I can not seem to find the answer too. Example 1 below works OK, but example two gives me a UnspecifiedLinkError: displayHelloWorld. They both access the same the class (the 3rd listed), which then access the JNI (c++) file that talks to a win32 dll.
Example 1, runs a stand alone application, while Example two extends a class, implements a few other classes, and as its name suggests is a plugin to a larger application
Why doesn't this work?
Thanks
Mark
//////////////////////////////
Example 1
///////////////////////////////
package com.ii.svr.qas;
public class test {
public static void main (String args[]) {
QASAddressChecker qas = new QASAddressChecker();
qas.test();
}
}
/////////////////////////////
Example Two
/////////////////////////////
package com.ii.svr.qas;
public class QASPlugin {
public QASPlugin() {
Test();
}
private Test() {
QASAddressChecker qas = new QASAddressChecker();
qas.test();
}
///////////////////////////////
/* This class is the one called by both the examples above */
///////////////////////////////
package com.ii.svr.qas;
import java.io.*;
public class QASAddressChecker {
public native String displayHelloWorld();
public QASAddressChecker() {
System.loadLibrary ("hello");
}
public String test() {
String result = displayHelloWorld();
System.out.println(result);
return result;
}
}
///////////////////////////
End of examples
////////////////////////////

