private void getMainClassesFromJar(List<String> mainClasses) {
        CodeSource src = Main.class.getProtectionDomain().getCodeSource();

        if (src != null) {
            URL jar = src.getLocation();
            ZipInputStream zip;

            try {
                zip = new ZipInputStream(jar.openStream());

                while (true) {
                    ZipEntry e = zip.getNextEntry();

                    if (e == null) {
                        break;
                    }

                    String fullpath = e.getName();

                    if (fullpath.endsWith(".class")) {
                        Path path = Paths.get(fullpath);
                        String filename = path.getFileName().toString();

                        if (filename.contains("$")) {
                            continue;
                        }

                        if (filename.equals(Main.class.getSimpleName() + ".class")) {
                            continue;
                        }

                        String clazzName = getClassNameFromPath(fullpath, "/");

                        if ((clazzName.length() != 0) && (checkMainMethodExists(clazzName) == true)) {
                            mainClasses.add(clazzName);
                        }
                    }
                }
            } catch (IOException ie) {
                ie.printStackTrace();
            }
        }
    }