public class Test {
static {
System.out.println("Hello from <clinit>");
}
public static void main(String[] args) {
System.out.println("Hello from main()");
}
}
...when run with: "java -cp . Test", produces the following:
Hello from <clinit>
Hello from main()
...but when run with: "java --dry-run -cp . Test", it still produces the following:
Hello from <clinit>
static {
System.out.println("Hello from <clinit>");
}
public static void main(String[] args) {
System.out.println("Hello from main()");
}
}
...when run with: "java -cp . Test", produces the following:
Hello from <clinit>
Hello from main()
...but when run with: "java --dry-run -cp . Test", it still produces the following:
Hello from <clinit>
- relates to
-
JDK-8159596 Add java --dry-run
-
- Closed
-