plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

Exception in thread "main" java.awt.HeadlessException #275

Open lra opened 4 years ago

lra commented 4 years ago

Hi,

I'm trying to run plantuml on a pristine MacOS 10.15.2 and I'm facing this issue:

$ plantuml
Exception in thread "main" java.awt.HeadlessException
    at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:165)
    at java.desktop/java.awt.Window.<init>(Window.java:538)
    at java.desktop/java.awt.Frame.<init>(Frame.java:423)
    at java.desktop/javax.swing.JFrame.<init>(JFrame.java:224)
    at net.sourceforge.plantuml.swing.MainWindow2.<init>(MainWindow2.java:159)
    at net.sourceforge.plantuml.Run.main(Run.java:164)

I installed it using homebrew which installed plantuml stable 1.2019.12. The java installed has been installed using homebrew too with brew cask install java:

$ java --version
openjdk 13.0.1 2019-10-15
OpenJDK Runtime Environment (build 13.0.1+9)
OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

I tried other java versions but am always getting the same error.

Any obvious requirement regarding the java version to install?

Thanks

junowilderness commented 4 years ago

I have the same issue with Oracle Java:

$ java -version
java version "13.0.1" 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
junowilderness commented 4 years ago

Have you tried subcommands?

I can process files:

plantuml myfile.puml

I can open the UI:

plantuml -gui
lra commented 4 years ago

Yes subcommands work fine, but calling plantuml without a subcommand throws an exception.

junowilderness commented 4 years ago

Yes, same here.

raochoar commented 4 years ago

Same here...

moderakh commented 4 years ago

same here

irmiller22 commented 3 years ago

Just ran into this as well. A little confusing that plantuml invocation throws an exception. Some output about possible commands to run would be helpful.

arnaudroques commented 3 years ago

Right, we are probably going to catch the exception and tell user to go to

ofloveandhate commented 1 year ago

I'm on Ventura, and was unable to run PlantUML on my mac for years because of this error. Neither of those links are useful at all to me.

The thing that got me going this morning was to invoke it with a subcommand --- from above, plantuml -gui provides me the familiary auto-compiling server. (I had been using the online server for the past long while, but it's tiresome and error prone to copy-paste my diagrams back and forth for version control, etc).

My criticism of the two links that show up when calling plantuml without any arguments:

IMO, it would be better to just tell the user to call plantuml with -gui if they want the server, and other arguments if one-shot compiling diagrams.

arnaudroques commented 1 year ago

IMO, it would be better to just tell the user to call plantuml with -gui if they want the server, and other arguments if one-shot compiling diagrams.

It would be nice if you could update the faq yourself. It's just easy as clicking on "edit this part".

Since we don't have any Mac, we do know even know what we are talking about :-)

Thanks for your help!

charlieblevins commented 1 year ago

I had the same experience on Ventura. I've updated the docs as suggested.

Blaisorblade commented 6 months ago

Thank you @charlieblevins — I tried to make that info more prominent since I struggled to find it.