【发布时间】:2019-01-31 05:46:40
【问题描述】:
这是我的代码
File file = ResourceUtils.getFile("classpath:run.sh");
String path = file.getAbsolutePath();
但是当我这样做时
Runtime.getRunTime().exec(path)
它抛出一个 FileNotFoundException
class path resource [run.sh] cannot be resolved to absolute file path because it
does not reside in the file system:
jar:file:/root/backend-2.1.2.RELEASE.jar!/BOOT-INF/classes!/run.sh
【问题讨论】: