private static String readMainClassFromManifest(String jarName) {
		try {
			ZipFile jarFile = new ZipFile(jarName);
			ZipEntry entry = jarFile.getEntry("META-INF/MANIFEST.MF");
			if (entry == null) return null;
			BufferedReader rd = new BufferedReader(new InputStreamReader(jarFile.getInputStream(entry)));
			for (String line = rd.readLine(); line != null; line = rd.readLine()) {
				if (line.startsWith("Main-Class:")) {
					return line.substring("Main-Class:".length()).trim();
				}
			}
			return null;
		} catch (IOException ex) {
			return null;
		}
	}