gwt-plugins / gwt-plugins/gwt-eclipse-plugin
Wrong default source level causes compilation problems (eg : with record objects)
- Ngôn ngữ chính
- Java
- Star
- 117
- Fork
- 49
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với cấu hình chạy CodeServer của plugin Eclipse GWT và tùy chọn biên dịch GWT, tập trung vào cách đối số sourceLevel được chọn. Tái hiện lỗi biên dịch record bằng các debug log đã báo cáo và so sánh với Maven build. Hoàn tất khi plugin sử dụng cấp độ trình biên dịch của project hoặc cung cấp một tùy chọn rõ ràng để thiết lập cấp độ đó, đồng thời ví dụ record biên dịch thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- build-system, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100