public static void main(final String[] args) {
		/* Set up the error handler as early as humanly possible. */
		ThreadGroup g = new ThreadGroup("Haven client") {
			@Override
			public void uncaughtException(Thread t, Throwable e) {
				APXUtils.handleException(t, e);
			}
		};
		Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
			@Override
			public void uncaughtException(Thread t, Throwable e) {
				APXUtils.handleException(t, e);
			}
		});
		String ed;
		if (!(ed = Utils.getprop("haven.errorurl", "")).equals("")) {
			try {
				final haven.error.ErrorHandler hg = new haven.error.ErrorHandler(
						new java.net.URL(ed));
				hg.sethandler(new haven.error.ErrorGui(null) {
					public void errorsent() {
						hg.interrupt();
					}
				});
				g = hg;
			} catch (java.net.MalformedURLException e) {
			}
		}
		Thread main = new HackThread(g, new Runnable() {
			public void run() {
				try {
					javabughack();
				} catch (InterruptedException e) {
					return;
				}
				main2(args);
			}
		}, "Haven main thread");
		main.start();
		try {
			main.join();
		} catch (InterruptedException e) {
			g.interrupt();
			return;
		}
		System.exit(0);
	}