Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

JDK java.lang.IllegalArgumentException: Illegal pattern character 'u'

0 votes

Since version 8037

rendering with a syntax error does not return a nice error image, but fails on 


java.lang.IllegalArgumentException: Illegal pattern character 'u'
at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768)
at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:475)
at net.sourceforge.plantuml.graphic.DateEventUtils.addEvent(DateEventUtils.java:60)
at net.sourceforge.plantuml.graphic.GraphicStrings.getTextBlock(GraphicStrings.java:130)
at net.sourceforge.plantuml.graphic.GraphicStrings.calculateDimension(GraphicStrings.java:152)
at net.sourceforge.plantuml.graphic.GraphicStrings.drawU(GraphicStrings.java:135)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.getFinalDimension(ImageBuilder.java:159)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageInternal(ImageBuilder.java:128)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(ImageBuilder.java:123)
at net.sourceforge.plantuml.PSystemError.exportDiagram(PSystemError.java:118)
at net.sourceforge.plantuml.SourceStringReader.generateImage(SourceStringReader.java:113)
    SourceStringReader reader = new SourceStringReader("@startuml\n" +
    "xxx\n" +
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    reader.generateImage(os, 0, new FileFormatOption(FileFormat.PNG));


JDK 1.7+ works fine, JDK fails

asked May 20, 2016 in bug by Meo (910 points)

1 Answer

0 votes
Best answer
Thanks for the feedback.

It's an issue with the Locale.

This has been fixed in last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Tell us if it's working for you.

answered May 21, 2016 by plantuml (125,190 points)
selected Jun 8, 2016 by Meo
It does not, new SimpleDateFormat("MM-dd-u", Locale.US) does not work for me - Illegal pattern character 'u'
Could you try : new SimpleDateFormat("MM-dd-u", Locale.ENGLISH)
same, I looked into docs, and 'u' is not in the table in JDK 1.6...
Ok, let's not use this 'u' anymore.
You'll find a new corrected beta here https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
If you need the patched class, it's here

Tell us if it's still not working for you!
that works fine, thanks!
Support This Project Offer 250 Mo! Follow PlantUML on Twitter