[英]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.