private static boolean classExists(String className) {
        try {
            Class.forName(className);
            return true;
        } catch (ClassNotFoundException e) {
            return false;
        }
    }
LuckPerms implementation for the Bukkit API.
bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java