diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index ea66940f..93c3d2ea 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -2234,9 +2234,16 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi throw new RuntimeException(e); } } - + //获取当前操作系统名称并转换为小写 + String os = System.getProperty("os.name").toLowerCase(); // 创建ProcessBuilder对象 - ProcessBuilder pb = new ProcessBuilder(parameterProperties.getFilePath() + StringPool.SLASH + "KORSUM.exe"); + ProcessBuilder pb = null; + //如果操作系统是windows 调用KORSUM.exe程序 + if (os.contains("win")) { + pb = new ProcessBuilder(parameterProperties.getFilePath() + StringPool.SLASH + "KORSUM.exe"); + } else { // 其他操作系统 调用KORSUM + pb = new ProcessBuilder(parameterProperties.getFilePath() + StringPool.SLASH + "KORSUM"); + } // 设置工作目录 pb.directory(new File(parameterProperties.getFilePath())); try {