when use plantuml.jar to run a state diagram, the text that goes along with the arrow btw two states don't display

0 votes
asked Jan 9, 2020 in Question / help by Tony
state diagram code in file called  test.txt:

 @startuml
     state1 -> state2 : textmsg
@enduml

when I run on a linux machine as following

linux>  java -jar plantuml.tar test.txt

it generate test.png. When display the diagram, text "textmsg" do not display.

What can cause the text not to display?

1 Answer

0 votes
answered Jan 9, 2020 by Serge Wenger Work (15,620 points)

For me, your sample is a "Sequence diagram". You need to specify that this is a state diagram for exemple like this:

@startuml
state state1
state1 -> state2:textmsg
@enduml

http://www.plantuml.com/plantuml/png/SoWkIImgAStDuG8oIb8LmAGX5uHIqBM321XPbQHMbEGMftCvfEQb05K30000 

commented Jan 9, 2020 by Tony
Thank you Serge.

 But even so, either sequence diagram or state diagram. The problem is still the same.

 When I run "java -jar plantuml.jar filename"  ...  "textmsg" is not display in the diagram.

Do you know why?
commented Jan 9, 2020 by albert (3,520 points)
@Tony

- which version of plantuml are you using?

- which version of java are you using

- did you try your plantuml code on: www.plantuml.com/plantuml

Maybe also the option `-Djava.awt.headless=true` might be useful so your command line would be:

java -Djava.awt.headless=true -jar plantuml.tar test.txt
...