Moving from Eclipse to VSCode by a Java Developer

Sat, 02 May 2020

#eclipse #vscode #java

I am working for a software editor and we mainly use Java as backend language. I use to work with Eclipse since around 2010, only for Java projects. Here is my journey and a quick comparison of the tools.

First of all I need to inform that I am actually Product Owner and not anymore a full-time developer. So I am still looking at Java source code project, but with a different level of usage than before.

VSCode setup

VSCode is relying a lot on extension. Each extension add a little extra power to the tool. So the initial text editor can be compared with a fully featured IDE once the right extensions have been installed.

I don't want to present each extension, I found this article which is describing that very well.

Globally you can relly on the Java Extension Pack that install all the main Java extensions for you.

Import a project?

This is I think the most important change between Eclipse and VSCode.

Eclipse is relying on a workspace concept where you import Java projects. My main concern with this approch is around multi-modules Maven projects : once you add or remove a module, Eclipse is lost and you need to import again the missing module.

VSCode is more like other editor (Atom...), and you can simply open a folder that contain your multi-modules Maven project. If some project have been removed then you will not see it anymore.

vscode.png
Folder presentation in VSCode

eclipse.png
Workspace in Eclipse

It's not a big difference but for me it is more easy to switch between projects. I do not loose anymore time to import projects, I just open the right folder. There is also a workspace system in VSCode to open multiple folder at once, it may be useful if you work on multiple projects at the same time (front and back for example).

Develop ?

The global experience is very good.

vscode-autocomplete.png

You still have auto-completion and JavaDoc is shown when it's necessary. There is also an equivalent of the Run Configuration with the Run panel to fire your project.

vscode-run-config.png
The Run panel rely on a launch.json file, and it can be saved on your git repository if you want to share it with team-workers.

Test ?

The right extension help to run tests. There is also some helpers to run the test directly before the test method or the test class.

vscode-test.png

Share your code ?

Git is directly available in VSCode. I have never rely on any Git add-on in Eclipse, as I found some products buggy. So I was relying only on the Git command line. I still rely a lot on the command line but I am happy to see this very good integration of Git directly into the product.