Intellij IDEA错误:无法在Scala项目中找到或加载主类org.jetbrains.jps.cmdline.Launcher

plupiseo  于 2023-01-26  发布在  Scala
关注(0)|答案(2)|浏览(511)

当我从Scala的简单Hello World程序中单击Run时,我遇到了以下错误。由于我是Java领域的初学者,我无法找到任何解决方案。
我目前使用IntelliJ IDEA 2021.2.3,我试图将其与Scala集成,但没有效果。我将按照本教程运行Scala程序,并安装本链接中提到的所有必需的软件和库。
https://www.guru99.com/scala-tutorial.html
Screenshot - Intellij IDEA Error for Scala Program

"C:\Program Files\Java\jdk1.8.0_144\bin\java.exe" -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs=\"\" -Dpreload.project.path=D:/Scala-Projects -Dpreload.config.path=C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/options -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djdt.compiler.useSingleThread=true -Daether.connector.resumeDownloads=false -Dio.netty.initialSeedUniquifier=-2427656205608767245 -Dfile.encoding=windows-1252 -Duser.language=en -Duser.country=US -Didea.paths.selector=IdeaIC2021.2 -Didea.home.path=D:/Softwares/ideaIC-2021.2.3.win -Didea.config.path=C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2 -Didea.plugins.path=C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins -Djps.log.dir=C:/Users/Khalid/AppData/Local/JetBrains/IdeaIC2021.2/log/build-log -Djps.fallback.jdk.home=D:/Softwares/ideaIC-2021.2.3.win/jbr -Djps.fallback.jdk.version=11.0.12 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=C:/Users/Khalid/AppData/Local/JetBrains/IdeaIC2021.2/compile-server/helloworld_14920d90/_temp_ -Djps.backward.ref.index.builder=true -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\"C:\Users\Khalid\AppData\Local\Temp\kotlin-idea-3911355212386532999-is-running\" -Dtmh.instrument.annotations=true -Dtmh.generate.line.numbers=true -Dcompile.parallel.max.threads=4 -Dcompile.parallel=true -Dscala.compile.server.socket.connect.timeout.milliseconds=10000 -Dscala.compiler.indices.rebuild=true -classpath "D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/jps-launcher.jar;C:/Program Files/Java/jdk1.8.0_144/lib/tools.jar" org.jetbrains.jps.cmdline.Launcher D:/Softwares/ideaIC-2021.2.3.win/lib/annotations.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/slf4j.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/jps-builders.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/kotlin-stdlib-jdk8.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/jps-model.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/javac2.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/forms_rt.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/maven-resolver-transport-file-1.3.3.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/util.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/protobuf-java-3.15.8.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/platform-api.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/jna-platform.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/aether-dependency-resolver.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/jps-javac-extension-1.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/jps-builders-6.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/jna.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/idea_rt.jar;D:/Softwares/ideaIC-2021.2.3.win/lib/3rd-party.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/maven-resolver-connector-basic-1.3.3.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/java/lib/maven-resolver-transport-http-1.3.3.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/Kotlin/lib/kotlin-reflect.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/Kotlin/lib/kotlin-plugin.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/IntelliLang/lib/java-langInjection-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/eclipse/lib/eclipse-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/eclipse/lib/eclipse-common.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/javaFX/lib/javaFX-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/javaFX/lib/javaFX-common.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/ant/lib/ant-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/Groovy/lib/groovy-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/Groovy/lib/groovy-constants-rt.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/maven/lib/maven-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/gradle-java/lib/gradle-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/Kotlin/lib/kotlin-jps-common.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/Kotlin/lib/kotlin-common.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/space/lib/space-java-jps.jar;D:/Softwares/ideaIC-2021.2.3.win/plugins/devkit/lib/devkit-jps.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/scala-library.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/compiler-shared.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/jps/nailgun.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/jps/compiler-jps.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/jps/sbt-interface.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/jps/incremental-compiler.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/jps/scala-parallel-collections.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/spray-json_2.13-1.3.5.jar;C:/Users/Khalid/AppData/Roaming/JetBrains/IdeaIC2021.2/plugins/Scala/lib/scala-compiler-indices-protocol_2.12-0.1.1.jar org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 57901 33b87547-d627-4a07-bd5f-0b53060f32c9 C:/Users/Khalid/AppData/Local/JetBrains/IdeaIC2021.2/compile-server
Error: Could not find or load main class org.jetbrains.jps.cmdline.Launcher
zbsbpyhn

zbsbpyhn1#

确保在运行配置对话框中正确指定了main类:

您可以从主工具栏打开它:

hk8txs48

hk8txs482#

我今天遇到了同样的问题,并最终能够通过使文件系统缓存无效来解决它。
在菜单中,* 文件 使缓存无效...*
然后勾选 * 清除文件系统缓存和本地历史记录 * 框
然后单击 * 失效并重新启动 *。

相关问题