如何为Eclipse配置构建路径、JDK及JRE?解决Gradle项目构建异常
Gradle构建正常但Eclipse提示构建路径异常
问题描述
某Hello World项目通过Gradle控制台命令可正常完成构建,但在Eclipse IDE中出现构建路径相关错误提示。点击提示行可打开项目「app」的Java构建路径属性设置界面。再次确认:命令行执行Gradle构建完全正常,项目构建配置文件为app/build.gradle。
系统环境信息
nicholas@mordor:~$ nicholas@mordor:~$ snap info eclipse name: eclipse summary: Extensible Tool Platform and Java IDE publisher: Snapcrafters✪ store-url: https://snapcraft.io/eclipse contact: https://github.com/snapcrafters/eclipse/issues license: unset description: | Eclipse provides IDEs and platforms for nearly every language and architecture. We are famous for our Java IDE, C/C++, JavaScript and PHP IDEs built on extensible platforms for creating desktop, Web and cloud IDEs. These platforms deliver the most extensive collection of add-on tools available for software developers. This snap is maintained by the Snapcrafters community, and is not necessarily endorsed or officially maintained by the upstream developers. commands: - eclipse snap-id: QzFGHW76hR3cZjpcuHt4sAjj5KZbd05T tracking: latest/stable refresh-date: today at 14:20 PDT channels: latest/stable: 2022-12 2023-06-16 (67) 329MB classic latest/candidate: 2023-03 2023-06-16 (68) 333MB classic latest/beta: ↑ latest/edge: 2023-03 2023-06-16 (69) 333MB classic installed: 2022-12 (67) 329MB classic nicholas@mordor:~$ nicholas@mordor:~$ gradle --version ------------------------------------------------------------ Gradle 8.1.1 ------------------------------------------------------------ Build time: 2023-04-21 12:31:26 UTC Revision: 1cf537a851c635c364a4214885f8b9798051175b Kotlin: 1.8.10 Groovy: 3.0.15 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 20.0.1 (Oracle Corporation 20.0.1+9-29) OS: Linux 5.19.0-45-generic amd64 nicholas@mordor:~$ nicholas@mordor:~$ javac --version javac 20.0.1 nicholas@mordor:~$ nicholas@mordor:~$ java --version java 20.0.1 2023-04-18 Java(TM) SE Runtime Environment (build 20.0.1+9-29) Java HotSpot(TM) 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing) nicholas@mordor:~$ nicholas@mordor:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy nicholas@mordor:~$
界面截图
- 项目状态与构建路径设置界面:


错误提示截图


内容的提问来源于stack exchange,提问作者Nicholas Saunders
相关产品推荐
相关产品推荐

