Java.io.tmpdir 目录不存在

问题描述 投票:0回答:1

当我在 intelij 上运行程序时,它显示此错误,我已经重新下载了很多次,但结果仍然相同。我是编程新手,所以我不知道该怎么做,有什么方法可以修复这个错误吗? 这个错误

Abnormal build process termination:
"C:\\Program Files\\Java\\jdk-23\\bin\\java.exe" -Xmx700m -Djava.awt.headless=true "-Djna.boot.library.path=C:\\Program Files\\JetBrains\\IntelliJ IDEA Community Edition 2024.2.4/lib/jna/amd64" -Djna.nosys=true -Djna.noclasspath=true --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Didea.IntToIntBtree.page.size=32768 -Djdt.compiler.useSingleThread=true -Daether.connector.resumeDownloads=false -Dio.netty.initialSeedUniquifier=5099883117943016963 -Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US -Didea.paths.selector=IdeaIC2024.2 "-Didea.home.path=C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4" -Didea.config.path=C:/Users/Hưởng/AppData/Roaming/JetBrains/IdeaIC2024.2 -Didea.plugins.path=C:/Users/Hưởng/AppData/Roaming/JetBrains/IdeaIC2024.2/plugins -Djps.log.dir=C:/Users/Hưởng/AppData/Local/JetBrains/IdeaIC2024.2/log/build-log "-Djps.fallback.jdk.home=C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/jbr" -Djps.fallback.jdk.version=21.0.4 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=C:/Users/Hưởng/AppData/Local/JetBrains/IdeaIC2024.2/compile-server/untitled2_1d2a6d90/_temp_ -Djps.backward.ref.index.builder=true -Djps.backward.ref.index.builder.fs.case.sensitive=false "-Djps.kotlin.home=C:\\Program Files\\JetBrains\\IntelliJ IDEA Community Edition 2024.2.4\\plugins\\Kotlin\\kotlinc" -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path="C:\\Users\\HNG\~1\\AppData\\Local\\Temp\\kotlin-idea-15111308323172465624-is-running" -Dide.propagate.context=false -classpath "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/jps-launcher.jar" org.jetbrains.jps.cmdline.Launcher "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/jps-builders.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/jps-builders-6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/jps-javac-extension.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/util-8.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/util_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/platform-loader.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/annotations.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/trove.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/jetbrains.kotlinx.metadata.jvm.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/protobuf.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/jps-model.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/javac2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/forms_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/aether-dependency-resolver.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/maven-resolver-connector-basic.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/maven-resolver-transport-file.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/maven-resolver-transport-http.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/idea_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/lib/util-8.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/java/lib/jps/java-compiler-charts-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/javaFX/lib/javaFX-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/javaFX/lib/javaFX-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/eclipse/lib/eclipse-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/eclipse/lib/eclipse-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/platform-langInjection/lib/java-langInjection-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/Groovy/lib/groovy-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/Groovy/lib/groovy-constants-rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/maven/lib/maven-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2024.2.4/plugins/gradle-java/lib/gradle-jps.jar" org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 61150 c22780a1-1eb9-40bb-9092-a243232e1493 C:/Users/Hưởng/AppData/Local/JetBrains/IdeaIC2024.2/compile-server
WARNING: java.io.tmpdir directory does not exist
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1161)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:340)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newMethodAccessor(MethodHandleAccessorFactory.java:71)
at java.base/jdk.internal.reflect.ReflectionFactory.newMethodAccessor(ReflectionFactory.java:154)
at java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:726)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at org.jetbrains.jps.cmdline.Launcher.main(Launcher.java:43)
Caused by: java.nio.file.InvalidPathException: Illegal char \<?\> at index 11: C:/Users/H�?ng/AppData/Local/JetBrains/IdeaIC2024.2/log/build-log\\build-log-jul.properties
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
at java.base/java.nio.file.Path.of(Path.java:148)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at org.jetbrains.jps.cmdline.LogSetup.initLoggers(LogSetup.java:30)
at org.jetbrains.jps.cmdline.BuildMain.\<clinit\>(BuildMain.java:43)

我尝试修复它,但不知道如何修复。

java kotlin directory
1个回答
0
投票

此错误可能是由于您的 Windows 用户名中的特殊字符导致的,这可能会导致文件路径出现问题。要修复此问题,请尝试以下操作之一:

设置临时目录:在 IntelliJ 中转到“文件”>“设置”>“构建、执行、部署”>“编译器”,然后设置自定义临时目录路径,不包含特殊字符。

以管理员身份运行 IntelliJ:右键单击 IntelliJ 并选择“以管理员身份运行”看看是否有帮助。

创建新的用户配置文件:考虑使用更简单的名称(例如,没有特殊字符)创建一个新的 Windows 用户配置文件,并尝试在其中运行 IntelliJ。

如果有帮助请告诉我!

© www.soinside.com 2019 - 2024. All rights reserved.