Avoid calling visualization code when no visualization is needed
When using the sat4j-sat.jar package without option (to discover them) on a machine without X server (a cluster), the app throws an exception because it tries to access X related features.
Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.sat4j.sat.RTSI.findnames(Unknown Source) at org.sat4j.sat.RTSI.find(Unknown Source) at org.sat4j.sat.RTSI.find(Unknown Source) at org.sat4j.sat.RTSI.find(Unknown Source) at org.sat4j.sat.Solvers.showAvailableRestarts(Unknown Source) at org.sat4j.sat.Solvers.usage(Unknown Source) at org.sat4j.sat.Launcher.usage(Unknown Source) at org.sat4j.sat.Launcher.run(Unknown Source) at org.sat4j.sat.Launcher.main(Unknown Source) Caused by: java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:261) at org.sat4j.sat.RemoteControlFrame.(Unknown Source) ... 11 more
Such code should only be launched when the visualization option is set.