kongdeqiang
2023-06-05 a41b28d983f46f90a41ff7d2aa47179541c1be99
src/main/java/com/boying/Application.java
@@ -1,11 +1,13 @@
package com.boying;
import cn.hutool.core.io.resource.ClassPathResource;
import net.sf.jni4net.Bridge;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.io.File;
import java.io.IOException;
@@ -28,9 +30,7 @@
    public static void getBean() throws IOException {
        Bridge.setVerbose(true);
        Bridge.init();
        //加载资源文件
        ClassPathResource classPathResource = new ClassPathResource("jni/LedShow.j4n.dll");
        File loadDll = classPathResource.getFile();
        File loadDll = new File("LedShow.j4n.dll");
        Bridge.LoadAndRegisterAssemblyFrom(loadDll);
    }
}