public static void main(String[] args) {

		directMW = true;

		// ModelerUtilities.printSystemProperties();

		checkMinimumJavaVersion();

		if (!"true".equalsIgnoreCase(System.getProperty("mw.newinstance"))) {
			// workaround to prevent the app from multiple instances
			preventMultipleInstances(args);
		}

		EventQueue.invokeLater(new Runnable() {
			public void run() {
				Initializer.sharedInstance().showSplashScreen();
			}
		});

		// feeding starting page and host flags
		if (args != null && args.length > 0) {
			hostIsLocal = "local".equalsIgnoreCase(args[0]);
			if (args.length > 1) {
				startingURL = args[1];
				if (startingURL != null) {
					if (System.getProperty("os.name").startsWith("Windows") && !FileUtilities.isRemote(startingURL)) {
						startingURL = startingURL.replace('/', '\\');
					}
					if (FileUtilities.isRelative(startingURL)) {
						startingURL = System.getProperty("user.dir") + System.getProperty("file.separator") + startingURL;
					}
				}
			}
		}

		mwLauncher = "yes".equals(System.getProperty("mw.launcher"));
		runOnCD = "true".equalsIgnoreCase(System.getProperty("mw.cd.mode"));

		// detect if the app is launched via webstart from its classloader. We use only two classloaders:
		// The SystemClassLoader and the JnlpClassLoader.
		ClassLoader cl = Thread.currentThread().getContextClassLoader();
		if (!cl.equals(ClassLoader.getSystemClassLoader()))
			launchedByJWS = true;

		// Workaround: Disable the default CookieHandler from Java Web Start, which prevents cookie from
		// being sent to the server through URLConnection.setRequestProperty
		if (launchedByJWS) {
			CookieHandler.setDefault(null);
		}

		// set locale if detected in the command line
		setLocale();

		if (IS_MAC) {
			System.setProperty("apple.laf.useScreenMenuBar", "false".equalsIgnoreCase(System.getProperty("mw.window.menubar")) ? "false" : "true");
			System.setProperty("apple.awt.brushMetalLook", "true");
		}

		if (hostIsLocal) {
			javax.swing.RepaintManager.setCurrentManager(new ThreadCheckingRepaintManager());
		}
		else {
			// warn user if the jar file is launched from untrusted path
			if (!launchedByJWS)
				warnAboutJar();
		}

		Debugger.print("Initialization");

		if (createUsingEDT) {

			EventQueue.invokeLater(new Runnable() {
				public void run() {
					// Initializer.sharedInstance().setMessage("Testing connection to the main MW server...");
					// ConnectionManager.sharedInstance().setWorkOffline(!ModelerUtilities.pingMwServer());
					Initializer.init();
					final Modeler m = createModeler();
					m.pack();
					m.setVisible(true);
					m.toFront();
					Initializer.sharedInstance().hideSplashScreen();
				}
			});

		}
		else {

			// loading worker thread
			final SwingWorker worker = new SwingWorker("Main loader", Thread.MIN_PRIORITY) {
				public Object construct() {
					Debugger.print("Starting main loader");
					// Initializer.sharedInstance().setMessage("Testing connection to the main MW server...");
					// ConnectionManager.sharedInstance().setWorkOffline(!ModelerUtilities.pingMwServer());
					Initializer.init();
					return createModeler();
				}

				public void finished() {
					Modeler m = (Modeler) get();
					Debugger.print("Modeler created");
					m.pack();
					m.editor.setToolBarOffset(-m.toolBar.getHeight());
					m.setVisible(true);
					Debugger.print("Modeler becomes visible");
					m.toFront();
					Debugger.print("Modeler brought to front");
					EventQueue.invokeLater(new Runnable() {
						public void run() {
							Initializer.sharedInstance().hideSplashScreen();
						}
					});
				}
			};
			// Spawn the loading thread from the EDT, instead of the main thread?
			EventQueue.invokeLater(new Runnable() {
				public void run() {
					worker.start();
				}
			});

		}

		// signify the web launcher who is monitoring this process
		if (mwLauncher)
			System.err.println("launched"); // why do we have to use the err stream?
		if (!hostIsLocal)
			LogDumper.sharedInstance().redirectSystemOutput();

	}