protected static boolean | generateAppImage(java.lang.String jarFile, java.lang.String binFile, int flags)Creates an application image file. It loads the Java classes
from the jarFile into the heap, verify the class
contents, and write the classes to an Application Image file as
specified by binFile .
int code = 0;
String[] classpath = new String[0]; // IMPL NOTE: specify the set of
// dynamic libs as well
String[] mainArgs = new String[3];
mainArgs[0] = jarFile;
mainArgs[1] = binFile;
mainArgs[2] = String.valueOf(flags);
try {
// IMPL NOTE: eliminate the hardcoded string constants
Isolate iso = new Isolate("com.sun.midp.main.AppImageWriter",
mainArgs, classpath);
iso.setAPIAccess(true);
iso.start();
iso.waitForExit();
code = iso.exitCode();
}
catch (IsolateStartupException ise) {
if (Logging.REPORT_LEVEL <= Logging.ERROR) {
Logging.report(Logging.ERROR, LogChannels.LC_AMS,
"Cannot startup isolate: " + ise);
}
}
return code == 0;
|