I have a java app that the user might invoke from the command line by running java -jar app.jar or from a desktop environment by double-clicking the .jar file.
I wo
You can use GraphicsEnvironment.isHeadless()