kongdeqiang
2025-02-21 15e5365f1a59fa0538fe4fcc71ef28a934f93f06
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 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;
@@ -24,13 +26,11 @@
        SpringApplication.run(Application.class, args);
    }
    @Bean
    public static void getBean() throws IOException {
        Bridge.setVerbose(true);
        Bridge.init();
        //加载资源文件
        ClassPathResource classPathResource = new ClassPathResource("jni/LedShow.j4n.dll");
        File loadDll = classPathResource.getFile();
        Bridge.LoadAndRegisterAssemblyFrom(loadDll);
    }
//    @Bean
//    public static void getBean() throws IOException {
//        Bridge.setVerbose(true);
//        Bridge.init();
//        File loadDll = new File("LedShow.j4n.dll");
//        Bridge.LoadAndRegisterAssemblyFrom(loadDll);
//    }
}