构建进程异常终止 IntelliJ IDEA

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

很长一段时间以来,我在尝试在 Intellij IDEA Community Edition 2023.3 中编译任何 Java 程序时遇到各种错误。

编译以下代码时:

import javax.swing.*;
import java.awt.*;
import java.util.Random;

public class Main {
class Ball{
    private JPanel panel;
    private Color color;
    private double angle;
    private double angularVelocity;
    private JSlider slider;

    public Ball(JPanel panel, Color color) {
        this.panel = panel;
        this.color = color;
        this.angle = Math.toRadians(new Random().nextDouble() * 360);
        this.angularVelocity = 0;
        this.slider = null;
    }
}

    public static void main(String[] args) {
    Main mainInstance = new Main();
    JPanel mainPanel = new JPanel();
    Color color = new Color(new Random().nextInt(0xFFFFFF));
    Ball ball = mainInstance.new Ball(mainPanel, color);
    System.out.println("Hello world!");
    }
} 

发生这些错误:

Abnormal build process termination: 
C:\Users\User\.jdks\openjdk-20.0.1\bin\java.exe -Xmx700m -Djava.awt.headless=true "-Djna.boot.library.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.3/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=-4475523539944712625 -Dfile.encoding=windows-1252 -Duser.language=pl -Duser.country=PL -Didea.paths.selector=IdeaIC2023.3 "-Didea.home.path=C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3" -Didea.config.path=C:/Users/User/AppData/Roaming/JetBrains/IdeaIC2023.3 -Didea.plugins.path=C:/Users/User/AppData/Roaming/JetBrains/IdeaIC2023.3/plugins -Djps.log.dir=C:/Users/User/AppData/Local/JetBrains/IdeaIC2023.3/log/build-log "-Djps.fallback.jdk.home=C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/jbr" -Djps.fallback.jdk.version=17.0.9 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=C:/Users/User/AppData/Local/JetBrains/IdeaIC2023.3/compile-server/testy_f26b6a2/_temp_ -Djps.backward.ref.index.builder=true "-Djps.kotlin.home=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.3\plugins\Kotlin\kotlinc" -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\"C:\Users\User\AppData\Local\Temp\kotlin-idea-14209173683669928946-is-running\" -Dide.propagate.context=false -classpath "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/jps-launcher.jar" org.jetbrains.jps.cmdline.Launcher "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/jps-builders.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/jps-builders-6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/jps-javac-extension.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/util-8.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/util_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/platform-loader.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/annotations.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/protobuf.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/jps-model.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/javac2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/forms_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/aether-dependency-resolver.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/maven-resolver-connector-basic.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/maven-resolver-transport-file.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/maven-resolver-transport-http.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/idea_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/lib/util-8.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/eclipse/lib/eclipse-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/eclipse/lib/eclipse-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/platform-langInjection/lib/java-langInjection-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/Groovy/lib/groovy-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/Groovy/lib/groovy-constants-rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/javaFX/lib/javaFX-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/javaFX/lib/javaFX-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/maven/lib/maven-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/space/lib/space-java-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/gradle-java/lib/gradle-jps.jar" org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 64578 b275ee6f-6e84-4f4c-8cf2-7737272038ac C:/Users/User/AppData/Local/JetBrains/IdeaIC2023.3/compile-server
WARNING: java.io.tmpdir directory does not exist
Be careful, logger will be shut down earlier than application: Unable to make field private static java.util.IdentityHashMap java.lang.ApplicationShutdownHooks.hooks accessible: module java.base does not "opens java.lang" to unnamed module @15aeb7ab
Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2023.3/plugins/java/lib/jps-launcher.jar
Error connecting to 127.0.0.1:64578; reason: Connection timed out: no further information: /127.0.0.1:64578
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: no further information: /127.0.0.1:64578
Caused by: java.net.ConnectException: Connection timed out: no further information
    at java.base/sun.nio.ch.Net.pollConnect(Native Method)
    at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:673)
    at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337)
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:689)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:652)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at java.base/java.lang.Thread.run(Thread.java:1623)
Exiting.

我尝试更换SDK,但从20.0.1更改为其他版本但没有效果

java intellij-idea compiler-errors runtime-error
1个回答
0
投票

不断改变 SDK,就是这么简单的白痴

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