Image: Gabriel Heinzer
VSCode for Java Projects
Tags: vscode, web dev, java, code editors, visual studio code
February 20, 2021
Can this be done?!
Short answer: Yes, you can!
How to setup
There are some additional extensions that you must install and you must be using Java version 11 or higher.
Java Extension Pack
Extensions required to use VSCode for Java projects are all bundled in an extension pack: Java Extension Pack.
Basically, install the extension and then open up a Java project. You're now able to operate like you would in IntelliJ or Eclipse but without all your fans running at full blast (at least that's been my experience). Also, the setup is painfully simple compared to other IDEs I've attempted to set up in the past (Not to mention this is all free).
Note: I kept hitting an annoying error:
java import ... cannot be resolved
but I performed java: clean
from the command palette and everything was back in action again.
Gradle
I work with Gradle so that requires another extension: Gradle Tasks. This extension will let you run all your Gradle-defined tasks
Conclusion
This is super straightforward. Note to self, try using VSCode for Java going forward.