-
-
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
Java 8 not supported #524
Comments
👤 lahoda 🕗 Feb 15, 2013 at 12:04 UTC Seems that lombok does not support Java 8 compiler. I have this simple source code:package java8test; import lombok.Getter; public class GetterTest {
}I am trying Lombok 0.11.6 from https://projectlombok.org/ and javac: Trying to compile the source code leads to an exception/warning: Note that daily/trunk builds of NetBeans are currently using javac from JDK8, and so lombok does not work on them: Note this does not apply to NetBeans 7.3, which is using JDK7 javac. |
👤 akobberup 🕗 Feb 15, 2013 at 12:19 UTC As a user of netbeans dev builds and a user of lombok also, i would be very glad to see support for jdk8 in lombok anytime soon! |
👤 r.spilker 🕗 Feb 15, 2013 at 13:16 UTC |
👤 r.spilker 🕗 Feb 15, 2013 at 13:17 UTC |
👤 grootjans 🕗 Mar 08, 2013 at 15:57 UTC Started a branch on github to add JDK8 support. |
👤 grootjans 🕗 Mar 08, 2013 at 15:58 UTC https://github.com/rzwitserloot/lombok/tree/jdk8support |
👤 danno.ferrin 🕗 Mar 15, 2013 at 18:01 UTC Here's a patch NB had to do for the typetags: http://netbeans.org/projects/java/lists/commits/archive/2013-01/message/141 |
👤 miena.moo 🕗 Apr 22, 2013 at 07:17 UTC Any news on this fix yet? :) |
👤 grootjans 🕗 Apr 22, 2013 at 21:44 UTC working hard on this, though limited by the free time we invest. Though JDK8 support is simple enough if we would completely fork lombok for jdk8, or drop support for all previous JDKs, this is just not how we would want this to work. This would also imply using a different lombok jar in netbeans runtime and in the build. Why is building it in one jar hard? We rely/need the internal AST of javac. In JDK8 they made some changes that are great for the AST, among others introducing actual enums for their constants, but less great for us. We have to make sure that we support, on runtime, both compiler versions. We're halfway there at this moment, with a few pesky problems to go, and then the challenge to adapt our build to test against JDK8. Untill now we used openJDK builds to test against, but there isn't a build of that yet for us to readily use. so, stay tuned. This definitely has our attention. |
👤 miena.moo 🕗 Apr 23, 2013 at 05:16 UTC Thanks a lot for the feedback! I quite understand how difficult maintaining backwards compatibility can be! :) |
👤 bleporini 🕗 Apr 27, 2013 at 06:26 UTC Hello, is there a repo where a SNAPSHOT release would be available? Regards |
👤 grootjans 🕗 Apr 27, 2013 at 07:49 UTC there is a branch on github, where lombok is developed, but no snapshot channel with our maven repo provider. At this point in time, though, this branch is in the wonderful state that it supports neither Java 7 or Java 8. |
👤 askoning 🕗 May 14, 2013 at 09:41 UTC Issue #551 has been merged into this issue. |
👤 Marek.Stefaniak 🕗 May 16, 2013 at 03:25 UTC github branch is not compiling using ant dist. lombok-jdk8support/src/utils/lombok/javac/JCNoTypeFactory.java:10: error: missing return statement When you have a look at source code: import com.sun.tools.javac.code.Symbol.TypeSymbol; public class JCNoTypeFactory {
} |
👤 michel.graciano 🕗 Jun 28, 2013 at 18:46 UTC There is any chance to you make available a SNAPSHOT version which works for JDK 8? IMHO you can make available a version which works only at JDK 8 for now, at least for us which wants to make some tests. Thanks in advance. |
👤 r.spilker 🕗 Jul 29, 2013 at 15:40 UTC We're working on it. We will expect to have something testable within a few weeks. That might sound like a lot of time, but there is a lot to be fixed and we only have so much time :-( |
👤 reinierz 🕗 Sep 09, 2013 at 22:13 UTC For the fans: We've got an initial release that retains its compatibility (including the new 'copy javadoc from field to generated getters/setters' stuff we've had some issues with) for JDK6/JDK7, and which also works on JDK8, though there are a select few corner cases that don't work yet, including some val corner cases, and the aforementioned javadoc copying thing which simply won't happen when delomboking with a JDK8's javac in your tools.jar of the VM you're running delombok on. Edge release is available here: https://projectlombok.org/download-edge.html Please let us know if this works for you, or if it doesn't! NB: It's time to go to bed; no time yet to test if this actually works on netbeans. Many kudos for the first one to chime in if this'll do it for recent netbeans releases, though! |
👤 michel.graciano 🕗 Sep 10, 2013 at 02:34 UTC Hi folks, First of all, I created a project with NetBeans 7.3.1 using lombok-edge with success and just tried to open it at NetBeans trunk build, but with the following error in the IDE log file: INFO [com.sun.tools.javac.processing.JavacProcessingEnvironment]: Annotation processing error: and the following error at IDE editor: Can't initialize javac processor due to (most likely) a class loader problem: java.lang.NoClassDefFoundError: Could not initialize class lombok.javac.handlers.HandleGetter I have tried even with the project configured to use JDK 7 and 8, with the same result. Can I do anything else to proceed the tests? Thanks in advance. |
👤 michel.graciano 🕗 Sep 10, 2013 at 02:36 UTC One additional comment is that I have enabled Annotation Processors in Editor at project properties. |
👤 michel.graciano 🕗 Sep 10, 2013 at 02:42 UTC I am attaching a sample project which works at NetBeans 7.3.1 but does not works for NetBeans trunk. I will test it against NetBeans 7.4 Beta tomorrow, but in the meantime I hope you can take a look at this. Regards |
👤 michel.graciano 🕗 Sep 10, 2013 at 02:42 UTC |
👤 reinierz 🕗 Sep 23, 2013 at 22:09 UTC Okay, we found it. Turns out calling JavaCompiler.version() doesn't return "1.8" as you might expect, but "(version info not available)". Dunce hat to team netbeans for that marvellous implementation of the 'version()' method. We found an alternate slightly hacky way (inspect the valid options for the -source parameter and parse the last one in the enum), which seems to be holding up. We only use it if the JavaCompiler.version() call produced a silly result. We'll try and push an updated edge release out the door later today, we have some debug work to undo :) |
👤 michel.graciano 🕗 Sep 23, 2013 at 22:21 UTC Shouldn't we try to patch NetBeans too? If you point me exactly in your code where do you need this info, I can try to debug and submit a patch directly to NetBeans team. |
👤 [email protected] 🕗 Sep 23, 2013 at 22:27 UTC You know it's managed by oracle right? |
👤 jirka.hana 🕗 Sep 23, 2013 at 22:32 UTC The last time I submitted a patch to NB, it was accepted and integrated |
👤 michel.graciano 🕗 Sep 23, 2013 at 22:37 UTC Yes, I know. I have been working with NetBeans team for more than a decade with huge success. I already have all the papers signed for OCA and so on, so if it really is a NetBeans issue, I am pretty sure we can handle it in NetBeans side too. I will take a look at this one today yet and maybe submit something asap. If you give me some coordinates at you code base, it gonna be easier to me. I hope I can handle NetBeans easier since I am already used to. |
👤 michel.graciano 🕗 Sep 23, 2013 at 23:28 UTC I have filed a issue against it https://netbeans.org/bugzilla/show_bug.cgi?id=236297. I am still working on it, so lets see if we have a workable patch soon. |
👤 reinierz 🕗 Sep 23, 2013 at 23:34 UTC Allright, new edge is built. We tested it ourselves on netbeans 7.4RC1 and a very casual test now indicates that this new edge version should do allright. Team netbeans users: Give it a new spin? Thanks a bunch! |
👤 reinierz 🕗 Sep 23, 2013 at 23:38 UTC @ michel.graciano: Yup, the resource file that contains the version stuff just isn't there, for some reason. The relevant code line is JavaCompiler's private static String version(String key) method. It loads resource "com.sun.tools.javac.resources.version", and it isn't there in netbeans's internal javac. |
👤 michel.graciano 🕗 Sep 23, 2013 at 23:51 UTC Hey guys, tested with success in NetBeans 7.4 daily build. Tomorrow I will test it more at work, with a bigger project (here I have just some test and simple projects), but so far so good. If some face some issus, you need just to remove your index cache (http://wiki.netbeans.org/FaqWhatIsUserdir). Thanks again guys. |
👤 piderman 🕗 Sep 24, 2013 at 08:02 UTC The fix seems to work on this end. I have tested the edge version of lombok in Netbeans 7.4RC1 and the errors go away. Reverting to lombok 0.12.0 brings the errors back, as expected. |
👤 DigitalZuzEL 🕗 Sep 24, 2013 at 08:13 UTC Thats great! When will you release stable version? Thanks again! |
👤 michel.graciano 🕗 Oct 11, 2013 at 13:41 UTC Lombok has released a stable version with this fix, but looks like we have a regression here. I am not sure if it is a regression from NetBeans or Lombok side, so I have filed in both projects. The Lombok issue is issue #626. Regards |
👤 michel.graciano 🕗 Oct 16, 2013 at 16:25 UTC I have updated issue #626 with NetBeans team comments and it is a Lombok issue. I should add that Lombok 1.12.2 is not even recommended to use with NetBeans 7.3.1. |
👤 r.spilker 🕗 Oct 22, 2013 at 16:10 UTC I'm going to close this issue, since most of the comments are about the Netbeans support, which is covered by issue #626. I'll create new issues regarding java 8 language support for both Eclipse and javac. |
End of migration |
I am executing a gralde build with jdk10 and get this error again:
|
@rasenderhase not related; you're merely getting the same error because lombok identifies java version 10-EA as unknown, falling back to thinking it must be a JDK6, which it isn't. Roel already fixed this part. |
Migrated from Google Code (issue 451)
The text was updated successfully, but these errors were encountered: