IntelliJ IDEA:无法找到或加载主类C:\ Program

我在IntelliJ IDEA构建项目时遇到问题。 我是Java和这个IDE的新手,所以我可能会犯一些愚蠢的错误。 无论如何,我确定这个项目写得不错。 这是我点击“ Build Project ”按钮后得到的消息:

 Error:Abnormal build process termination: C:\Users\artartart\.IdeaIC2017.2\config\jdks\jbsdk8u112b287.2_windows_x64\jre\bin\java -Xmx4096m -Djava.awt.headless=true -Djava.endorsed.dirs=\"\" -Djdt.compiler.useSingleThread=true -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djava.net.preferIPv4Stack=true -Dio.netty.initialSeedUniquifier=3244537063909990413 C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.4\plugins\android\lib\lombok-ast-0.2.3.jar -Dfile.encoding=windows-1250 -Djps.file.types.component.name=CommunityFileTypes -Duser.language=pl -Duser.country=PL -Didea.paths.selector=IdeaIC2017.2 "-Didea.home.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.4" -Didea.config.path=C:\Users\artartart\.IdeaIC2017.2\config -Didea.plugins.path=C:\Users\artartart\.IdeaIC2017.2\config\plugins -Djps.log.dir=C:/Users/artartart/.IdeaIC2017.2/system/log/build-log -Djps.fallback.jdk.home=C:/Users/artartart/.IdeaIC2017.2/config/jdks/jbsdk8u112b287.2_windows_x64 -Djps.fallback.jdk.version=1.8.0_112-release -Dio.netty.noUnsafe=true -Djava.io.tmpdir=C:/Users/artartart/.IdeaIC2017.2/system/compile-server/lux_f88e3d21/_temp_ -Djps.backward.ref.index.builder=true -Dkotlin.incremental.compilation.experimental=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\"C:\Users\ARTART~1\AppData\Local\Temp\kotlin-idea-2207181666383577824-is-running\" -classpath "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jps-launcher.jar;C:/Users/artartart/.IdeaIC2017.2/config/jdks/jbsdk8u112b287.2_windows_x64/lib/tools.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/optimizedFileManager.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/ecj-4.6.2.jar" org.jetbrains.jps.cmdline.Launcher "C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/log4j.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/resources_en.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jna.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/snappy-in-java-0.5.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jps-builders.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/maven-aether-provider-3.3.9-all.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/lz4-java-1.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jps-builders-6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jdom.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/annotations.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/slf4j-api-1.7.10.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/forms_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/netty-all-4.1.10.Final.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/httpcore-4.4.5.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/aether-1.1.0-all.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/protobuf-2.5.0.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/javac2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/commons-codec-1.9.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/asm-all.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jps-model.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/nanoxml-2.2.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/openapi.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/oromatcher.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/aether-dependency-resolver.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/idea_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jgoodies-forms.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/httpclient-4.5.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/commons-logging-1.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/trove4j.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/jna-platform.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/gson-2.5.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/jarutils.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/guava-21.0.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/android-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/gradle/lib/gradle-tooling-api-3.5.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/gson-2.5.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/jarutils.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/lib/guava-21.0.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/android-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/gradle/lib/gradle-tooling-api-3.5.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/ant/lib/ant-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/devkit/lib/devkit-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/uiDesigner/lib/jps/ui-designer-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/IntelliLang/lib/intellilang-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Groovy/lib/groovy-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Groovy/lib/groovy-rt-constants.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/eclipse/lib/eclipse-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/eclipse/lib/common-eclipse-util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/maven/lib/maven-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/maven/lib/plexus-utils-2.0.6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/gradle/lib/gradle-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/jps/android-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/jps/android-gradle-jps.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/android-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/android-rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/sdk-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/repository.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/sdklib.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/jarutils.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/layoutlib-api.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/android/lib/manifest-merger.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Kotlin/lib/kotlin-runtime.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Kotlin/lib/kotlin-reflect.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Kotlin/lib/kotlin-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Kotlin/lib/android-extensions-ide.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/Kotlin/lib/android-extensions-compiler.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/javaFX/lib/javaFX-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2017.2.4/plugins/javaFX/lib/common-javaFX-plugin.jar" org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 65171 0e58ca16-00f9-4b57-8012-4ea0e9b5be70 C:/Users/artartart/.IdeaIC2017.2/system/compile-server Error: Could not find or load main class C:\Program 

我找不到任何解决方案来解决这个问题。 我正在运行IntelliJ IDEA 2017.2.4 x64JDK: 1.8 x64 ,该项目基于JDK 1.6

我一直在寻找最后几个小时的解决方案,没有任何帮助。 我不确定我是否提供了足够的信息。 如果没有 – 让我知道:)

谢谢!

2 Solutions collect form web for “IntelliJ IDEA:无法找到或加载主类C:\ Program”

这是由于目录名称中的空格未被命令中的引号包围。

无论增加什么

 C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.4\plugins\android\lib\lombok-ast-0.2.3.jar 

到你的构建命令是错误的。

看起来像命令行在第一个空白之后中断。 所以尝试将所有包含空白的参数包含在双引号中:

 "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.4\plugins\android\lib\lombok-ast-0.2.3.jar" 
  • 索贝尔过滤器使用
  • 简单的方法来找出一个类是匿名/对象,并从Kotlin实例中获取具体的类名
  • Kotlin期望的属性获得者或设置者
  • 为什么我们编写NextActivity :: class.java,尽管这是一个kotlin类?
  • 我的TextView看不到
  • 如何用Java按媒体密钥?
  • 在Spring Boot 2.0.0.M1中将Jackson配置为“全局”使用SNAKE_CASE
  • 在java类中调用扩展函数作为任何RX操作符
  • 将用于复制资产文件的java代码转换为Android中的缓存文件夹到Kotlin的最佳实践
  • 如何通过键加入两个RxJava2 Obvervables?
  • Kotlin和Gradle没有Maven中央?
  • Kotlin language will be the best programming language for Android.