set gmti parser dynamic library JNA path.(opencv jni path not working leave it just so)
This commit is contained in:
parent
395f69fda7
commit
62317aab51
@ -5,11 +5,27 @@ import org.springframework.boot.SpringApplication;
|
|||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@MapperScan("com.zhangy.skyeye.**.mapper")
|
@MapperScan("com.zhangy.skyeye.**.mapper")
|
||||||
@SpringBootApplication(scanBasePackages = "com.zhangy.**")
|
@SpringBootApplication(scanBasePackages = "com.zhangy.**")
|
||||||
public class SEApplication {
|
public class SEApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
String projectRoot = System.getProperty("user.dir");
|
||||||
|
// String libPath = projectRoot + "/library/logisen/GMTI";
|
||||||
|
// System.setProperty("jna.library.path", libPath);
|
||||||
|
// 1. GMTI 路径
|
||||||
|
String gmtiPath = projectRoot + "/library/logisen/GMTI";
|
||||||
|
// 2. OpenCV 路径 (根据您的目录名: opencv-4.11.0-windows)
|
||||||
|
String opencvPath = projectRoot + "/library/opencv-4.11.0-windows";
|
||||||
|
|
||||||
|
// 使用 File.pathSeparator (Windows是分号; Linux是冒号:) 连接多个路径
|
||||||
|
String combinedPath = gmtiPath + File.pathSeparator + opencvPath;
|
||||||
|
|
||||||
|
System.setProperty("jna.library.path", combinedPath);
|
||||||
|
// 如果 OpenCV 使用的是标准 JNI (System.loadLibrary),可能还需要设置 java.library.path
|
||||||
|
System.setProperty("java.library.path", opencvPath);
|
||||||
SpringApplication.run(SEApplication.class, args);
|
SpringApplication.run(SEApplication.class, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user