Java ProcessBuilder | IOException:无法运行程序“ / usr / lib / jvm / java-8-oracle / jre / bin / java”(在目录“ servers / 296ae19e”中)

时间:2018-07-06 09:12:58

标签: java ioexception processbuilder

嗨,StackOverflowers!

让我告诉你我的问题: 我想使用ProcessBuilder在Java中启动minecraft服务器,我只能启动一台服务器,但是在第二台服务器上却出现此错误:

https://hastebin.com/hibirakana.lua

这是我的代码:

ProcessBuilder builder = new ProcessBuilder(
                System.getenv("JAVA_HOME") + File.separator + "jre/bin/java",
                "-Xmx" + template.getMaxRam() + "G",
                "-Xms10M",
                "-Dcom.mojang.eula.agree=true",
                "-DIReallyKnowWhatIAmDoingThisUpdate=true",
                "-jar",
                "spigot.jar",
                "--port",
                port + ""
        );

        builder.directory(new File("servers/" + name + "/"));
        builder.redirectErrorStream(true);

感谢您将来的帮助!

丹。

0 个答案:

没有答案