oracle / nb-javac

nb-javac is the Java compiler plugin used by the Apache NetBeans Java Editor
GNU General Public License v2.0
20 stars 21 forks source link

Preparing JDK8-ready update of nb-javac 15.0.0.x #9

Closed JaroslavTulach closed 3 years ago

JaroslavTulach commented 3 years ago

Thanks to @monacotoni a release of nb-javac 15.0.0.1 has been uploaded to Maven central. Alas, thanks to incomplete instructions provided by me, the version 15.0.0.1 cannot run on JDK8 (which is its main goal). Please beg my pardon. This PR tries to fix it:

@Akshay-Gupta-Oracle please consider merging this and tag the release "somehow". I write "somehow" as there is the release130 branch and the actual release naming scheme is up to you. However I'd very much prefer to use git tag 15.0.0.2. Once the PR is in and there is a tag/branch let's ask @monacotoni to upload 15.0.0.2 to Maven.

Please note that accepting this PR and tagging doesn't yet constitute a release. As such I'd suggest to do it without further delay to compensate for my failure in preparing 15.0.0.1 Maven release properly. Once again please accept my apology and sorry for the unnecessary inconveniences.

CCing @eppleton, @jlahoda, @matthiasblaesing

matthiasblaesing commented 3 years ago

Sorry, I forgot to check the class version of the maven artifact - bad luck. We could bikeshed how to check for JDK8, but the approach looks like a workable solution. A quick test with OpenJDK on Ubuntu showed, that the system JDK 11 is rejected, while a custom installed JDK 8 works. Thank you.

lahodaj commented 3 years ago

FWIW, it problem is much more subtle than the classfile versions (that would be easier to find). The issue is that this version of nb-javac was compiled against the JDK 9+ (actually probably JDK 15) version of the JDK classes, and particularly ByteBuffer, which has new covariant overrides for certain methods and which are then used/invoked from nb-javac, but do not exist in JDK 8. I think this solution is fine for the time being.

arvindaprameya commented 3 years ago

Approved the changes, there would however be no new set of jar files released in github

eppleton commented 3 years ago

I've uploaded the bits to a staging repository in case you want to test them before I release them to Maven Central:

https://oss.sonatype.org/content/repositories/comdukescript-1138/

matthiasblaesing commented 3 years ago

To my understanding this indicates that the build is clean JDK8 build. @JaroslavTulach do you want to give it a spin also?

matthiasblaesing commented 3 years ago

Oh - and thank you @eppleton!