All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.JarStart Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit;

public final class JarStart {
    /**
     * If the user use java -jar to start the server.
     */
    private static boolean usingJavaJar = false;

    public static void main(String[] args) {
        try {
            Thread.currentThread().getContextClassLoader().loadClass("joptsimple.OptionSpec");
        } catch (ClassNotFoundException | java.lang.NoClassDefFoundError e) {
            // There are no libs now. It means that even logger cannot be used.
            System.out.println("No libraries detected. PowerNukkitX cannot work without them and will now exit.");
            System.out.println("Do NOT use java -jar to run PowerNukkitX!");
            System.out.println("For more information. See https://doc.powernukkitx.cn");
            return;
        }
        usingJavaJar = true;
        Nukkit.main(args);
    }

    public static boolean isUsingJavaJar() {
        return usingJavaJar;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy