Skip to content
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

Automatically generate nb-javac from JDK sources #12

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

JaroslavTulach
Copy link
Contributor

@JaroslavTulach JaroslavTulach commented Mar 7, 2021

The nb-javac overview proposal suggests to minimize differences between JDK's javac and nb-javac by automatically applying advanced refactorings and thus making sure the javac from recent JDK can run on JDK8. This PR is implementation of that idea.

The best part of this PR is the deletion of more than 230 000 lines of code, that are no longer needed to be maintained. Rather than that the build script starts by checking out a JDK repository (currently at revision JDK-16+36). The src/java.compiler and src.jdk.compiler sources are then massaged to use only JDK8 APIs using advanced refactorings transformations. As a result of that the nb-javac sources can link against JDK8+ APIs.

The next step is to take the code and compile the source to JDK8's bytecode. Once finished, the outcome remains the same: two JAR files in the make/langtools/netbeans/nb-javac/dist/ folder. Those can be used and tested with any JDK8+.

@jtulach jtulach force-pushed the jtulach/BackportingUpstreamJavac branch from 0d09dcf to 60e817e Compare March 7, 2021 20:04
@jtulach jtulach force-pushed the jtulach/BackportingUpstreamJavac branch from 5fa0f8d to 39be830 Compare March 8, 2021 05:04
@dukescript
Copy link

I can confirm that this builds fine with JDK 14.0.2, and I've uploaded the bits for testing.

https://oss.sonatype.org/content/repositories/comdukescript-1139/com/dukescript/nbjavac/nb-javac/

@dukescript
Copy link

The build works fine with JDK 14.0.2, and the staged bits are available here:
https://oss.sonatype.org/content/repositories/comdukescript-1140/

@mbien
Copy link

mbien commented Oct 6, 2021

this is pretty cool. How comes that this didn't make it in yet?

@nbauma109
Copy link

nbauma109 commented Mar 2, 2022

@JaroslavTulach : does this also work with JDK 17 or only JDK 14 ?

lahodaj pushed a commit to lahodaj/nb-javac that referenced this pull request Dec 9, 2024
upgrade javac dependency to 19.0.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants