publicstaticvoid main(String... args) throws Exception {
File badFile = new File("bad.exe");
File testJar = new File("test.jar");
File fooJava = new File("Foo.java");
File barJava = new File("Bar.java");
// create a jar by compiling a file, and append the jar to some // arbitrary data to offset the start of the zip/jar archive
Utils.createJavaFile(fooJava);
Utils.compile("-doe", "-verbose", fooJava.getName());
String[] jarArgs = { "cvf", testJar.getAbsolutePath(), "Foo.class"
};
Utils.jarTool.run(jarArgs);
Utils.cat(badFile, fooJava, testJar);
// create test file and use the above file as a classpath
Utils.createJavaFile(barJava); try { if (!Utils.compile("-doe", "-verbose", "-cp", badFile.getAbsolutePath(), "Bar.java")) { thrownew RuntimeException("test fails javac did not compile");
}
} finally {
Utils.deleteFile(badFile);
Utils.deleteFile(testJar);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.