日期:2014-05-20 浏览次数:21011 次
package jni;
public class HelloWorld {
static{
System.loadLibrary("helloworld");
}
public native void dispHelloWorld();
/**
* @param args
*/
public static void main(String[] args) {
// TODOAuto-generated method stub
//System.getProperty("java.library.path");
new HelloWorld().dispHelloWorld();
}
}
// Invoked in the java.lang.Runtime class to implement load and loadLibrary.
static void loadLibrary(Class fromClass, String name,
boolean isAbsolute) {
try {
if (!DownloadManager.isJREComplete() &&
!DownloadManager.isCurrentThreadDownloading()) {
DownloadManager.downloadFile("bin/" +
System.mapLibraryName(name));
// it doesn't matter if the downloadFile call returns false --
// it probably just means that this is a user library, as
// opposed to a JRE library
}
} catch (IOException e) {