RFR: 8297455: Use the official ToolProvider API to call javac [v3]

Magnus Ihse Bursie ihse at openjdk.org
Fri Dec 2 00:03:37 UTC 2022

> In JDK-8297041, the javacserver was moved out of the JDK itself, and lifted out as a separate buildtool. Due to this, internal classes in jdk.compiler were no longer available. Therefore, the closest way to calling javac as before were to use `com.sun.tools.javac.Main.compile()`. This method is however deprecated for removal, and relying on that was only needed as a temporary measure during the transition.
> After the major refactoring of the javacserver tool in JDK-8297444, it will be easy to replace the Main.compile API with the official ToolProvider API instead.

Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:

 - Merge branch 'master' of https://git.openjdk.org/jdk into use-toolprovider-in-javacserver
 - 8297455: Use the official ToolProvider API to call javac
 - 8297444: Refactor the javacserver build tool


Changes: https://git.openjdk.org/jdk/pull/11299/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11299&range=02
  Stats: 12 lines in 1 file changed: 7 ins; 2 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/11299.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11299/head:pull/11299

PR: https://git.openjdk.org/jdk/pull/11299

More information about the compiler-dev mailing list