gwt-plugins / gwt-plugins/gwt-eclipse-plugin
Wrong default source level causes compilation problems (eg : with record objects)
- 主要语言
- Java
- 星标
- 117
- 派生
- 49
- PR 合并指标
- 30 天内没有已合并 PR
描述
I spent hours to solve a problem and wanted to report it here to help other people that will be concerned.
Thanks to chat gpt and Claude, i found the solution, i dont know how i would be able to find it before.
I don't know what is the default value for -sourceLevel program argument in the GWT eclipse plugin CodeServer run configuration, or in the GWT > compile option with right click on the project, but for some reason the plugin was not using the Java JDK version of the project, or the version of the workspace, and that was resulting to that kind of errors for a record type object (not a class) that was on my understanding managed since GWT SDK 2.12.0 :
`org.yp.client.model.Currency; did you forget to inherit a required module? Checked 2 dependencies for errors. Tracing compile failure path for type 'org.yp.client.view.dialog.linkpay.LinkPayEditor' Errors in 'file:/C:/DEV/GIT_FILES/WEB_NEPTING/admin_wa/src/main/java/org/yp/client/view/dialog/linkpay/LinkPayEditor.java' Line 126: No source code is available for type org.yp.client.model.Currency; did you forget to inherit a required module? Checked 1`
thanks to debug logs added with GWT plugin options in compiler i was able to understand better that it was a java compiler version issue that was not supporting record types :
Line 5: Syntax error on token "record", @ expected Line 11:
The compilation was fine with maven, but not with this GWT eclipse plugin, so that's why i managed to understand the issue, the plugin uses his own Java compiler or source level and not the one from the Eclipse Workspace or for the current project.
So the question is, why the plugin is not using the compiler version of the project, or why there is no clear options to set it ?
Regards
贡献指南
这个仓库没有索引到贡献指南
调研方向
从 GWT Eclipse plugin CodeServer 运行配置和 GWT 编译选项入手,重点关注如何选择 sourceLevel 参数。使用报告中的调试日志重现 record 编译失败,并将其与 Maven 构建进行比较。当插件使用项目编译器级别或提供明确的选项来设置该级别,并且 record 示例能够成功编译时,即可视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- build-system, tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100