当我打印错误流时,我使用命令Runtime.getRuntime().exec("java -jar file.jar"); I get the error Unable to access jarfile我尝试在将类路径设置为当前目录的情况下作为Runtime.getRuntime().exec("java -cp . -jar file.jar");运行,但仍然得到相同的错误。我还尝试给出jar文件的完整路径。当我这样做时,j
我遇到了一个关于Runtime.getRuntime().exec(String)失败的问题,它在我们的应用程序中创建了一个新的进程。linux系统上的配置如下下面是作为新进程运行TestProcess类的代码片段:
process = Runtime.getRuntimeexec (new String[] {"/bin/sh",&q