This question already has an answer here:
- Was my Jar double clicked, or launched from the command line? 1 answer
Is there a way to check if the jar was launched from command line via 'java -jar test.jar' or via double click in explorer? I want it to start in nogui mode if it was executed from the command prompt.