// VM Detection Logic /////////////////////////////////////////////////////////////////////
- public static void forceLoad() { } ///< do-nothing method that forces <clinit> to run
-
// If you create a new subclass of Platform, you should add logic
// here to detect it. Do not reference your class directly -- use
// reflection.
- static {
+ public static void forceLoad() {
System.err.print("Detecting JVM...");
try {
String vendor = System.getProperty("java.vendor", "");
}
System.err.println(" " + os_name + " ==> org.xwt.plat." + platform_class);
- if (platform_class != null) Class.forName("org.xwt.plat." + platform_class).newInstance();
+ try {
+ if (platform_class != null) Class.forName("org.xwt.plat." + platform_class).newInstance();
+ } catch (InstantiationException e) {
+ throw e.getCause();
+ }
String term = Platform.getEnv("TERM");
Log.color = term != null && term.length() != 0 && !term.equals("cygwin");
Log.diag(Platform.class, " class = " + platform.getClass().getName());
platform.postInit();
- } catch (Exception e) {
+ } catch (Throwable e) {
Log.error(Platform.class, "Exception while trying to detect JVM");
Log.error(Platform.class, e);
criticalAbort("Unable to detect JVM");