public static void setNativesLocation() {

        String libraryPath;
        if (new File("lib").exists()) {
            if(System.getProperty("os.name").toLowerCase().contains("linux")) {
                libraryPath = new File("lib").getAbsolutePath() + File.separator + "linux";
            }
            else if(System.getProperty("os.name").toLowerCase().contains("mac")){
                libraryPath = new File("lib").getAbsolutePath() + File.separator + "osx";
            }
            else {
                libraryPath = new File("lib").getAbsolutePath() +
                        File.separator + System.getProperty("sun.desktop");
            }
        } else {
            log("Running inside IDE");
            Game.setRunningInIdea();

            if(System.getProperty("os.name").toLowerCase().contains("linux")){
                libraryPath = new File("target").getAbsolutePath() +
                        File.separator + "build" +
                        File.separator + "lib" +
                        File.separator + "linux";
            }
            else if(System.getProperty("os.name").toLowerCase().contains("mac")){
                libraryPath = new File("target").getAbsolutePath() +
                        File.separator + "build" +
                        File.separator + "lib" +
                        File.separator + "osx";
            }
            else {
                libraryPath = new File("target").getAbsolutePath() +
                        File.separator + "build" +
                        File.separator + "lib" +
                        File.separator + System.getProperty("sun.desktop");
            }
        }

        try {
            addLibraryPath(libraryPath);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }