-
Notifications
You must be signed in to change notification settings - Fork 1
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
Access Javac API from a standalone javac jar instead of the default JDK runtime #924
base: dom-with-javac
Are you sure you want to change the base?
Access Javac API from a standalone javac jar instead of the default JDK runtime #924
Conversation
Does the launch configuration or the java command still set the |
I removed the Line 565 in d8b4f12
|
Found this on ClearlyDefined with a score that makes it usable, Update: It is Approved ✔️ |
In recent commits, I addressed two issues:
In the latest commit, the DOM resolver already works with the embedded Javac. But for the build support, it still has some problems because the apt plugin is not loaded well. Here are some potential issues to look further.
|
I attempted to convert the
I guess this dependency issue is why the javac plugin is set up as a fragment of jdt.core, allowing it to share the same classloader. |
@@ -5,7 +5,10 @@ Bundle-SymbolicName: org.eclipse.jdt.core.javac;singleton:=true | |||
Bundle-Version: 1.0.0.qualifier | |||
Fragment-Host: org.eclipse.jdt.core | |||
Automatic-Module-Name: org.eclipse.jdt.core.javac | |||
Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=23))" | |||
Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://ci.eclipse.org/ls/job/jdt-core-incubator/job/PR-924/3/console , this breaks current compilation since some Java 21 features are already adopted in the code. Would 21 be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it breaks Java 21 usage (e.g. some utility of String and pattern matching). We need to rewrite them with Java 17 compatible way. The purpose here is to make the minimum JDK requirement same as other JDT plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, at this stage, we should minimize the changes in the code and stick to Java 21 to facilitate progress. When we've adopted nb-javac, then we'll be more easily able to move code back to Java 17. Moreover, m2e already requires Java 21, so JDT-LS already requires Java 21, so trying to go below that won't produce any benefit for JDT-LS nor vscode-java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see redhat.java extension still requires a minimum Java 17 because it stays at [email protected]. Good to know we're going to upgrade to Java 21.
- This also fixes the quickfix as a result eg. ```java Function<Integer, Integer> func = x -> { System.out.println(x); }; ``` becomes ```java Function<Integer, Integer> func = x -> { System.out.println(x); return x; }; ``` Signed-off-by: David Thompson <[email protected]>
Different versions of Java allow different modifiers on interface methods, so ECJ generates slightly different problem ids for each of these cases. Use the compiler settings to determine which to use. This affects the logic of the quick fixes, so it should fix some jdt-ls test cases. Signed-off-by: David Thompson <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
hashcode/equals
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]> Fix regression Signed-off-by: Rob Stryker <[email protected]> Fix regressions Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
…compilation unit Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
Signed-off-by: Rob Stryker <[email protected]>
For snippet javadoc issue in the PR #812, this is just a formatting thing. I'm not too worried about its support when we switch to nb-javac. We can implement a simple algorithm to handle it ourselves or reuse the solution of ECJ such as eclipse-jdt#60. |
7f5c20a
to
87832d6
Compare
For the license, here is the hint from EDP handbook: https://www.eclipse.org/projects/handbook/#ip-sbom . We should probably add an |
aa3b08f
to
cc0dccd
Compare
7e220b3
to
525cd23
Compare
Split javac jar reference into a separate PR #1082, and add |
630ab89
to
141942c
Compare
9c17bb6
to
4516c31
Compare
a1bf22f
to
0b6fd1c
Compare
7ad387c
to
c52dfb2
Compare
c52dfb2
to
76e9c9c
Compare
838c386
to
40594bf
Compare
15d0bf3
to
811bae7
Compare
c906abc
to
b53a413
Compare
08ec5cf
to
10fe71a
Compare
c2b9da2
to
c640bdc
Compare
1bb87f3
to
197281f
Compare
This PR tries to introduce a standalone Javac jar from the repository https://github.com/JaroslavTulach/nb-javac for Javac API access within our project. The benefit is that it allows the language server to support latest language features without requiring user to run the language server with the latest JDK.
This PR is an experiment PR, not full ready yet. It faces some issues with new approach, and I open the PR first for suggestions and feedback.