我不能在Mac操作系统上用OpenJDK 8运行PlantUML。我从AdoptOpenJDK macOS站点下载了1.8.0u192版本:
$ java -version
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_192-b12)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.192-b12, mixed mode)
如果我试图用PlantUML处理一个简单的图表,就会得到以下错误消息:
$ java -jar plantuml.1.2018.14.jar example.puml
Exception in thread "main" java.lang.UnsatisfiedLinkError: /private/tmp/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib: dlopen(/private/tmp/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
Referenced from: /private/tmp/jdk8u192-b12/Contents/Home/jre/lib/libfontmanager.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:61)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerNativeLibrary.<clinit>(FontManagerNativeLibrary.java:32)
at sun.font.SunFontManager$1.run(SunFontManager.java:339)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.<clinit>(SunFontManager.java:335)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:863)
at net.sourceforge.plantuml.Run.forceOpenJdkResourceLoad(Run.java:234)
at net.sourceforge.plantuml.Run.main(Run.java:143)
误差与图表无关。我甚至不能从项目主页处理最简单的PlantUML图:
@startuml
Bob -> Alice : hello
@enduml