protected static String readMainClassFromCommandLine(String line) {
		if (line == null) return null;
		boolean jarFlag = false;
		try {
			StreamTokenizer tokenizer = new StreamTokenizer(new StringReader(line));
			tokenizer.resetSyntax();
			tokenizer.wordChars(33, 255);
			tokenizer.quoteChar('"');
			tokenizer.quoteChar('\'');
			tokenizer.whitespaceChars(' ', ' ');
			tokenizer.whitespaceChars('\t', '\t');
			boolean cmdRead = false;
			while (true) {
				int tt = tokenizer.nextToken();
				String token = tokenizer.sval;
				switch (tt) {
				  case StreamTokenizer.TT_EOF:
					return null;
				  case StreamTokenizer.TT_WORD: case '"': case '\'':
					break;
				  default:
					return null;
				}
				if (cmdRead) {
					if (token.startsWith("-")) {
						if (token.equals("-jar")) {
							jarFlag = true;
						} else if (token.equals("-cp") || token.equals("-classpath")) {
							tokenizer.nextToken();
						}
					} else {
						if (jarFlag) return readMainClassFromManifest(token);
						return token;
					}
				} else {
					cmdRead = true;
				}
			}
		} catch (IOException ex) {
			/* Empty */
		}
		return null;
	}