How to add natives using ProcessBuilder?

时间:2017-12-28 20:47:57

标签: java native processbuilder

I'm working on a launcher for my project using a ProcessBuilder. In this project I use LWJGL so I need the natives. But with which command do I load the natives for specific libraries?

This is my code now and I only have to add the natives:

    for (File file : libDir.listFiles()) {
        if (file.getAbsolutePath().endsWith(".jar")) {
            System.out.println(file.getAbsolutePath());
            commands.add("-cp " + file.getAbsolutePath());
        }
    }

    for (File file : nativeDir.listFiles()) {
        if (file.getAbsolutePath().endsWith(".dll"))
            System.out.println(file.getAbsolutePath());
    }

    commands.add("-Xms" + ram);
    commands.add("-Xmx" + ram);

    commands.add("-jar " + mainFile.getAbsolutePath());

    sc.close();
}

0 个答案:

没有答案