-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Support for Java9+ in JRE emulation? #97
Comments
The proper way is to change the JDK version for Bazel which we piggy back on: However for this particular case (JDK 11), we need additional work in boostrapping due to change around Java modules. The good things is, this will work soonish. |
Great, thank you! I am in no rush, just wanted to get the question out there. |
Is the problem the |
(A year later) is this still planned for "soon" or is there a different workaround? |
Different workaround. Add this to j2cl_library() in BUILD:
(Thanks to original poster niloc132 for source diving this.) |
While exploring https://groups.google.com/d/topic/google-web-toolkit-contributors/eyBpbrtYgyY/discussion and using newer language features in the JRE, I ran into an issue with the
j2cl_library
mechanism as it applies to the JRE (viaj2cl_mirror_from_gwt
). The easiest way to reproduce it is to take a class already in //jre/java somewhere and update it to use a Java9+ feature - my quick testing sample was tweaking java.lang.Class.getSimpleName() to usevar
instead ofString
when declaring the local variablecanonicalName
:From what I can glean, the way to supporting
var
(by updating to lang level 10 or higher) would be to modifyj2cl_mirror_from_gwt
's ownjava_library
and add this line:However, doing this results in nearly every JRE emul file failing with this error:
I also tried the now-deprecated source/target flags:
javacopts = ["-source 10", "-target 10"],
Is there a more correct way to use
j2cl_library
to build JRE emulation that uses language features beyond Java 8?The text was updated successfully, but these errors were encountered: