简体   繁体   English

为什么我的 gradle 项目在我输入句点 ('.') 时显示“此编译单元不在 Java 项目的构建路径上”?

[英]Why is my gradle project saying "This compilation unit is not on the build path of a Java project" whenever I type a period ('.')?

I've imported a gradle java project from PluralSight to try and code along with the lesson;我从 PluralSight 导入了一个 gradle java 项目,以尝试与课程一起编写代码; it's being taught with IntelliJ, and I'm using Eclipse.它是用 IntelliJ 教授的,我正在使用 Eclipse。 Now for some reason whenever I try to use a period (ie, System.out.println()), I keep getting the build path error message.现在由于某种原因,每当我尝试使用句点(即 System.out.println())时,我都会不断收到构建路径错误消息。 How can I fix this, or barring that, how can I set up a run configuration for the finished code in Eclipse?我该如何解决这个问题,或者除此之外,如何为 Eclipse 中的完成代码设置运行配置?

Your source file is not set to be compiled as far as Eclipse understands your project setup.就 Eclipse 了解您的项目设置而言,您的源文件未设置为编译。

Open the Properties dialog of the project and on its Java Build Path page, make sure your source folders are as they should be.打开项目的“属性”对话框,并在其 Java 构建路径页面上,确保您的源文件夹是应有的。 You might want to add the "eclipse" plug-in to your gradle script and run the "eclipse" task to handle this for you.您可能希望将“eclipse”插件添加到您的 gradle 脚本并运行“eclipse”任务来为您处理这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 编译单元不在 Java 项目的构建路径上 - Maven - The compilation unit is not on the build path of a Java project - Maven 此编译单元不在 Java 项目的构建路径上 - This compilation unit is not on the build path of a Java project 编译单元不在 Java 项目的构建路径上 - Compilation unit is not on the build path of a Java project Eclipse Oxygen 这个编译单元不在java项目的构建路径上 - Eclipse Oxygen This compilation unit is not on build path of java project Eclipse错误“此编译单元不在Java项目的构建路径上 - Eclipse error "This compilation unit is not on the build path of a Java project Eclipse Maven - 代码完成失败“此编译单元不在 Java 项目的构建路径上”和“无法下载索引”错误 - Eclipse Maven - Code Completion fails "This compilation unit is not on the build path of a Java project" and "Failed to Download Index" Error 为什么我的 Gradle Java 项目不在 Intellij 中构建? - Why my Gradle Java project doesn't build in Intellij? 我的Java项目的gradle构建错误 - Error for gradle build for my Java project 如何在编译之前修改 Gradle 项目中的 Java 源代码而不修改磁盘上的文件? - How can I modify Java source code in my Gradle project prior to compilation without modifying the files on disk? 我的项目无法运行,说“构建失败” - my project failed to run , saying "build failed"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM