All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.yapbam.gui.Launcher Maven / Gradle / Ivy

The newest version!
package net.yapbam.gui;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.text.MessageFormat;

import javax.swing.JOptionPane;

public class Launcher {
	private static final String REQUIRED_JAVA_VERSION = "1.6";
	private static final String JAR_FILE_NAME = "program.jar";
	private static final String CLASS_NAME = "net.yapbam.gui.MainFrame";
	
	private Launcher() {
	}
	
	public static void main(String[] args) {
//		Iterator it = System.getProperties().keySet().iterator();
//		while (it.hasNext()) {
//			String next = (String) it.next();
//			System.out.println (next+" -> "+System.getProperty(next));
//		}
		
		String current = System.getProperty("java.specification.version");
		if (Float.parseFloat(current)A program file is missing ("+jarFile.getAbsolutePath()+").

You should install Yapbam again in order to fix it.
"); } // The new ClassLoader will be left opened because it will be used until the end of the program to get application's classes return new URLClassLoader(new URL[]{jarFile.toURI().toURL()}).loadClass(CLASS_NAME); } catch (URISyntaxException e) { throw new RuntimeException(e); } catch (MalformedURLException e) { throw new RuntimeException(e); } } private static boolean noJar() { try { Class.forName(CLASS_NAME); return true; } catch (ClassNotFoundException e) { return false; } } private static void error(Throwable e) { String pattern = "A fatal error occurs ({0}).
Maybe a program file is corrupted.
" + "
You should install Yapbam again in order to fix it.
"; error(MessageFormat.format(pattern, new Object[]{e.toString()})); } private static void error(String message) { JOptionPane.showMessageDialog(null, message, "Sorry, unable to launch Yapbam", JOptionPane.ERROR_MESSAGE); System.exit(-1); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy