这是我的代码
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
答案 0 :(得分:1)
不。您的操作系统不知道如何从存档中运行应用程序。