Java 报错java.Net.UnknownHostException:raw.githubusercontent.com

发布时间:2024年01月24日

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

然后测试导出成功

文章来源:https://blog.csdn.net/lvi_166/article/details/135827100
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。