// Set an empty classpath to override any inherited setting of CLASSPATH
expectPass(classpath(""), JAVAC, "Hello.java Bye.java");
// test jar creation without manifest //
expectPass(JAR, "cfe Hello.jar Hello Hello.class");
expectPass(JAVA, "-jar Hello.jar");
// test for overriding the manifest during jar creation //
Files.writeString(Path.of("MANIFEST.MF"), "Main-Class: Hello\n", StandardOpenOption.APPEND);
// test for error: " 'e' flag and manifest with the 'Main-Class' // attribute cannot be specified together, during creation
expectFail(JAR, "cmfe MANIFEST.MF Bye.jar Bye Bye.class");
// test for overriding the manifest when updating the jar //
expectPass(JAR, "cfe greetings.jar Hello Hello.class");
expectPass(JAR, "ufe greetings.jar Bye Bye.class");
expectPass(JAVA, "-jar greetings.jar");
// test for error: " 'e' flag and manifest with the 'Main-Class' // attribute cannot be specified together, during update
expectFail(JAR, "umfe MANIFEST.MF greetings.jar Hello");
// test jar update when there are no input files
expectPass(JAR, "ufe Hello.jar Bye");
expectFail(JAVA, "-jar Hello.jar");
expectPass(JAR, "umf MANIFEST.MF Hello.jar");
// test creating jar when the to-be-archived files // do not contain the specified main class, there is no check done // for the presence of the main class, so the test will pass //
expectPass(JAR, "cfe Hello.jar Hello Bye.class");
// Jar creation and update when there is no manifest and inputfiles // specified
expectFail(JAR, "cvf A.jar");
expectFail(JAR, "uvf A.jar");
// error: no such file or directory
expectFail(JAR, "cvf A.jar non-existing.file");
expectFail(JAR, "uvf A.jar non-existing.file");
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 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.