return Functions.getCurrentLocale();
}
});
// quick check to see if we (seem to) have enough permissions to run. (see #719)
JVM jvm;
try {
jvm = new JVM();
new URLClassLoader(new URL[0],getClass().getClassLoader());
} catch(SecurityException e) {
context.setAttribute(APP,new InsufficientPermissionDetected(e));
return;
}
try {// remove Sun PKCS11 provider if present. See http://wiki.jenkins-ci.org/display/JENKINS/Solaris+Issue+6276483
Security.removeProvider("SunPKCS11-Solaris");
} catch (SecurityException e) {
// ignore this error.
}
installLogger();
final FileAndDescription describedHomeDir = getHomeDir(event);
final File home = describedHomeDir.file.getAbsoluteFile();
home.mkdirs();
System.out.println("Jenkins home directory: "+home+" found at: "+describedHomeDir.description);
// check that home exists (as mkdirs could have failed silently), otherwise throw a meaningful error
if (! home.exists()) {
context.setAttribute(APP,new NoHomeDir(home));
return;
}
// make sure that we are using XStream in the "enhanced" (JVM-specific) mode
if(jvm.bestReflectionProvider().getClass()==PureJavaReflectionProvider.class) {
// nope
context.setAttribute(APP,new IncompatibleVMDetected());
return;
}