In this article we will get a development setup for Spring Boot projects using VSCode and WSL2.
It's been a while since I last tried to use VSCode for Java development. Last time I decided not to make the switch from IntelliJ IDEA.IntelliJ IDEA is a wonderful project. Jetbrains have trully created something beautiful. There's only a small caveat. It costs lots of money.Ever try to convince your boss to switch development for your team from something free (Netbeans, Eclipse [sic]) to IDEA? The argument "can do the same things but more efficiently, and it costs loads of money" doesn't fly well.
Here's how to get a development setup ready for free!
Enable the following extensions in VSCode:
Reload VSCode just to be sure and let's get started.
Now that VSCode has been restarted you will notice that there is a new icon on the sidebar.
Assuming you have correctly installed WSL2 and a distribution, you should be able to "see" into the distro from this view.You can either create a new project within WSL2 or clone your existing projects. I have cloned under my home directory in WSL2.
From the sidebar you can now:
You should now have a modern IDE for working with Java including features such as IntelliSense, integrated debugger and many more.I have been using this setup for more than 3 months and I am qute happy with it. I really don't miss any features of IDEA.
One added benefit of using VSCode is that you can import multiple projects using a workspace. These projects can (in my case) also include a front-end application. This way you can code / run / debug your entire application from within VSCode.