public static void main(String[] args) {

		if (InstanceChecker.lockInstance("./lock")) {

			final RemoteResourcesServer localServer = RemoteResourcesServer
					.newInstance(args, true);
			localServer.start();

			java.awt.EventQueue.invokeLater(new Runnable() {
				@Override
				public void run() {

					RemoteResourcesConfiguration.getInstance().load(
							new File(RemoteResourcesConfiguration
									.getRemoteResourcesDir()
									+ File.separator
									+ "remote.cfg"));

					RemoteResourcesInitialPanel l = new RemoteResourcesInitialPanel();

					while (!localServer.isStarted()) {
						try {
							Thread.sleep(100);
						} catch (InterruptedException e) {
							// do nothing
						}
					}
					try {

						ClientConnectionManager.getInstance().connect(
								ClientConnectionManager.LOCALHOST,
								RemoteResourcesConfiguration.getInstance()
										.getServerPort());
					} catch (Exception e) {
						ClientLogger
								.error(RemoteResources.class,
										RemoteResourcesLocalization
												.getMessage(RemoteResourcesMessages.RemoteResources_Error_ConnectionError),
										e);
					}
				}
			});
		} else {
			JOptionPane
					.showConfirmDialog(
							null,
							RemoteResourcesLocalization
									.getMessage(RemoteResourcesMessages.RemoteResources_OneInstance),
							"Remote Resources", JOptionPane.DEFAULT_OPTION,
							JOptionPane.INFORMATION_MESSAGE);
		}
	}