1.写一个Java类,如
package test;
public class Hello{
static void copy() {
// 获取服务器所使用的操作系统Windows或者Linux
String osInfo = System.getProperty("os.name");
String path="";
String aPath="";
File javaHello = null;
String fileName = "";
if (osInfo.toLowerCase().indexOf("windows") != -1){
path = System.getProperty("java.library.path");
aPath = path.substring(0, path.indexOf(';'));
javahello= new File(aPath + File.separator + "jnihello.dll");
fileName = "jnihello.dll";
}
else{
path = System.getProperty("java.library.path");//将.dll或者.so拷贝到java.library.path下
aPath = path.substring(0, path.indexOf(':'));
javaencrypt = new File(aPath + File.separator + "libj