-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add jdk9 compiler support #985
Comments
I've just created an edge release. This takes care of the I only tested |
Building with Bazel works now. Thanks! |
can we get this released ? Cheers |
Any chance that this will be released to maven soon? |
The fixes are part of version 1.16.8, that has been released 2016-03-07. Are you already using that version? |
Let me give it a shot again. |
It seems like it works! |
Hey, since JDK 9 is coming closer - are there any updates regarding this issue? Cheers, |
There's still too much motion on the module specification to have any meaningful estimation. I'm convinced it will work in the end. I do fear that there need to be compiler flags to open up to lombok. How bad it will be, we don't know yet. |
I tried to switch my project to jdk9 in heroku and got the same error. |
JDK 9 rampdown has begun, so I think it's safe to start working on this. |
@javadev What do you mean by "the same error"? |
It's a little hard to tell what is already fixed, and what isn't. I'm specifically concerned about |
Sorry, misunderstood ... those --add-opens are needed for the javac invocation for compiling code that uses lombok. |
The new JDK9 flag |
with lombok 1.16.16 and errorprone 2.0.19 (plexus-compiler-javac-errorprone 2.8.1), everything appears to work but outputs this troubling looking stack trace during compilation:
Is that a known/expected/safe error? |
No. I've just pushed 539b2a7 to add some additional debug information. Can you please download the edge release and compile with that? You will probably need to do some maven magic to use this jar, like put it in your cache under the wrong name. It will not fix your problem, but will help us fix it, so please tell us if you now get an IllegalArgumentException, and what the message is, |
|
Thanks. We've just created a new edge release, that just might fix your problem. Can you please try it again? |
Getting a different exception with the latest edge release:
|
I encountered the same issue with @jbarnettwomply. Looking forward for your solution, thx! :) |
@rspilker Bazel test is failing although Baazel build is perfect working. |
@slf4j doesn't work in java 9 , and module-info.java add 'require static lomlok',cannot found symbol: variable log while compiling in intellij 2018 EAP idea, and install lombok plugin,use lomlok.jar with latest version(1.16.20). |
@godpit do you have an example project (basically a Minimal, Complete, and Verifiable example)? In my project |
+1, Lombok plugin is not compatible with IntelliJ 2018 EAP yet. |
@krzyk I try to use intellij 2017.3.4,but it also doesn't work, however i try to use java 8, it work well. |
Lombok in Eclipse fails the build with the following error when adding a module-info.java to the project:
|
I tested a minimal project setup with edge release. As soon as I add module-info.java with single line |
1.18.0 is still not working with module-info.java (IntelliJ IDEA 2018.1.3), although release 1.16.22 has this note:
|
After moving lombok to class path, compilation succeeded, but when I run application I get this error:
|
I get the same error.
In my module-info I added
but when I run my application in Eclipse Photon I get the error:
|
Issue #1806 - the above problem has been rosolved in the edge version. |
What edge version? I am using the latest one (119-769185e1 - from here) and it is still present. To clarify I mean the |
@hughjdavey the 'edge' version can be downloaded from here https://projectlombok.org/download-edge |
@hughjdavey yes the mapstruct error still exists, |
@hughjdavey Did you also add the mapstruct-processor-1.3.0.Beta1.jar to your module path? When I did that the error disappeared. |
Sorry I could have mentioned about the mapstruct-processor. |
@tzieleniewski so no need to do |
@arrowman53 how do I do that? Is it one of those |
@hughjdavey Yes, its the --add-modules you need to add it to. |
@hughjdavey I am not familiar with Gradle but my investigation with Maven showed that Maven during compilation adds to the module path those dependencies which are modular JARs, other dependencies are added to classpath (unnamed module). So in my case it was not the --add-modules missing. I needed to extend the list of observable modules. For that purpose I used the --upgrade-module-path parameter. Otherwise org.mapstruct.ap.spi, as a not modular JAR, would not be resolable. |
At this point, lombok works fine in jdk9. I see lots of comments, many referencing gradle and such. That's a different issue (and various gradle issues have already been filed). |
Status (Updated 2018-01-09)
--add-opens
parameters, we can compile code that contains lombok annotations on build 9.0.1+11module-info.java
is not present for lombok, so far lombok can only be used on the classpath, It's uncertain if you can compile modules.@javax.annotation.Generated
will no longer be generated by default, see belowMost recent information (Based on build 9.0.1+11)
module jdk.compiler does not "opens com.sun.tools.javac.processing" to unnamed module @6b927fb
Lombok uses non-exposed APIs. We need to instruct the jvm that that's okay.
According to this mail by Mark Reinhold we can replace all the
--add-opens
clauses by--permit-illegal-access
in a future version of jdk9. However, that will generate warnings on the stderr. Using --add-opens does not.package javax.annotation is not visible
Since 1.16.20, this message will only occur if your explicitly turned it on in
lombok.config
usinglombok.addJavaxGeneratedAnnotation = true
.If specified, lombok adds
@javax.annotation.Generated("lombok")
to all generated methods.Since the new module system, this annotation is no longer standard available.
There are two ways to fix this:
Remove the following line from your project
lombok.config
file:Add
--add-modules=java.xml.ws.annotation
to your javac command line parameters.This description will be updated if more information is available.
The text was updated successfully, but these errors were encountered: