问题与处理策略

问题描述
  • 在启动 JAR 包时,报如下错误
org.springframework.context.ApplicationContextException: Unable to start web server

Caused by: org.springframework.boot.web.server.WebServerException: Unable to create tempDir. java.io.tmpdir is set to C:\Users...
# 翻译

org.springframework.context.ApplicationContextException 异常:无法启动 WEB 服务器

原因:org.springframework.boot.web.server.WebServerException 异常:无法创建 tempDir
问题原因
  • 这个问题是 Java 程序没有权限对于 java.io.tmpdir 指定的临时目录的进行创建或访问
处理策略
  • 在启动 JAR 包时,指定临时目录路径
java -Djava.io.tmpdir=【临时目录路径】 -jar 【JAR 包路径】
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐