1.问题
今天在vscode 学习如何使用 plantUML生成图片的时候,发生错误
java.util.concurrent.ExecutionException: java.net.UnknownHostException: raw.githubusercontent.com
issue raw.githubusercontent.com java.util.concurrent.ExecutionException: java.net.UnknownHostException: raw.githubusercontent.com
Exception in thread "main" java.lang.UnsupportedOperationException: PDF
at net.sourceforge.plantuml.ugraphic.ImageBuilder.createUGraphic(ImageBuilder.java:433)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageInternal(ImageBuilder.java:275)
at net.sourceforge.plantuml.ugraphic.ImageBuilder.write(ImageBuilder.java:246)
at net.sourceforge.plantuml.PlainDiagram.exportDiagramNow(PlainDiagram.java:66)
at net.sourceforge.plantuml.error.PSystemError.exportDiagramNow(PSystemError.java:245)
at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:178)
at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:172)
at net.sourceforge.plantuml.Pipe.generateDiagram(Pipe.java:100)
at net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:92)
at net.sourceforge.plantuml.Run.managePipe(Run.java:354)
at net.sourceforge.plantuml.Run.main(Run.java:181)
原因在于无法访问 raw.githubusercontent.com
2.修改Hosts解决
Vscode 打开C:\Windows\System32\drivers\etc\Hosts文件添加一行
185.199.109.133 raw.githubusercontent.com
然后测试导出成功