I've created an application in java that can be run on Windows in GUI or in command line, and also on Linux in bash. My problem is that when I run it in Linux I get the "No X11 DISPLAY variable was set" which I know comes from the fact that I create some frames in my program, but only if it's run on Windows with GUI.
How can I make this exception not appear while running the program in Linux?