public class trial {
static {
System.out.println("Main not required to print this");
System.exit(0);
}
}
This code still throws an error as
Error: Main method not found in class trial, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application**
There were posts saying that it will work in java 1.9 but it doesn't.