public static void checkIfHeadless(String className) {
		if (!JTFTools.testDebugOption("headless")) {
			try {
				Class<?> graphicsEnvironmentClass = Class.forName("java.awt.GraphicsEnvironment");
				Method isHeadless = graphicsEnvironmentClass.getMethod("isHeadless", new Class[0]);
				if (!Boolean.TRUE.equals(isHeadless.invoke(null, new Object[0]))) return;
			} catch (Exception ex) {
				return;
			}
		}
		try {
			ClassLoader loader = new CommandLineProgramLoader(className);
			Class<?> mainClass = loader.loadClass(className);
			CommandLineProgram program = (CommandLineProgram) mainClass.newInstance();
			program.init();
			program.run();
			program.exit();
		} catch (Exception ex) {
			throw new ErrorException(ex);
		}
	}