Hi everyone, we are pleased to announce partial support of Javac as the underlying compiler in Visual Studio Code Java, JDT, and JDT-LS. The effort to provide this support has been a joint collaboration with Red Hat and Microsoft and is nearly a year in the making.
This change aims to ensure timely support for the latest Java features and align Java language support on VS Code more closely with common build tools (such as Maven, Gradle). Many of our users have shared the desire for a more seamless, out-of-the-box development experience, and we believe introducing Javac is a strong first step toward making that happen.
Users can expect the following benefits from Javac based tooling
- Compiler correctness more in line with the Java specification
- Faster support for new Java versions in both VS Code and Eclipse
- Less maintenance overhead for teams working on JDT, and JDT-LS
- Easier testing of preview features and versions of Java not yet released
Please note that JDT on Javac is meant as an alternative to the ECJ compiler, and is not intended to act as a replacement in any way. Currently, the Javac based support in VS Code Java is turned off by default, but can be enabled with the following way.
- Install the latest pre-release version of the “Language Support for Java by Red Hat” or “Extension Pack for Java”.
- Set “java.jdt.ls.javac.enabled“: “on” in your VS Code settings. Here’s a screenshot
- Point “java.jdt.ls.java.home” to your Java 23 installation.
- Restart VS Code.
Javac support on VS Code currently offers good edit assistance: diagnostics, quick-fix/refactoring, hover, navigation, indexing, build and class file generation are all working smoothly using Javac. In the future we plan to deliver:
- Usability: make search, completion, matching and proceed on error totally functional on par with ECJ
- Performance:
- Remove noticeable performance slowdowns compared to ECJ based compilation/diagnostics
- Investigate benchmark tests in VS Code Java and JDT-LS
- Getting started experience: remove the dependency on a new JDK (e.g. JDK 23) to enable Javac support
- Upstream current work into JDT so that Javac support can be dogfooded in Eclipse
This initiative was also announced at the recent OpenCommunity-X conference in Mainz, Germany. While the development of Javac support for JDT is happening in a JDT-core fork, all work will be contributed back to upstream JDT. Upstreaming efforts have already started and will be ongoing as feature parity progresses.
Javac upport for VS Code Java is an important step in our efforts to offer faster support for new Java versions and minimizing the compiler differences. We hope that you try out this preview support and share your feedback with us!
Install Extension Pack for Java
To use all features mentioned above, please download and install Extension Pack for Java on Visual Studio Code.
Feedback and suggestions
As always, your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to give us feedback
- Leave your comment on this blog post
- Open an issue on our GitHub Issues page
- Send an email to: vscjfeedback@microsoft.com
Resources
Here is a list of links that are helpful to learn Java on Visual Studio Code.
- Learn more about Java on Visual Studio Code.
0 comments
Be the first to start the discussion.