DEV Community

Cover image for Moving from Eclipse to VSCode by a Java Developer
Julien Bras
Julien Bras

Posted on • Updated on • Originally published at sidoine.org

Moving from Eclipse to VSCode by a Java Developer

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.

Alt Text

Folder presentation in VSCode

Alt Text

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.

Alt Text

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.

Alt Text

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.

Alt Text

Share your code ?

Git is directly available in VSCode. I have never rely on any Git addon 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.

Alt Text

And you have some indicator directly in the editor (green if new line, red if removed lines...). I have never see this kind of indication inside Eclipse. Probably I have never installed the right extension ;)

Run tooling (Maven, etc) ?

There is also a Maven extension that let you execute all Maven commands. But here I prefer using the excellent terminal that let you do what you want. It's here, just use it.

Alt Text

Conclusion

One month after VSCode installation and first test on Java projects, I realize that I haven't opened anymore Eclipse. Just today to make a screenshot...
I have not yet speak of the performance too. I have a decent MBP and Eclipse take always a couple of seconds to startup. VSCode start in less than a second.
Last, I am not only coding in Java but also Javascript. I have originally installed VSCode to replace Atom editor for my JS projects... So I am happy to be able to use a single tool for all my programming needs. It's faster and I am more comfortable to use a single tool for coding.
So just an advice: get a try on one of your Java project, you may be surprised to change your habits !

Top comments (18)

Collapse
 
cmanique profile image
Carlos Manique Silva

I tried it, but still think it falls behind most of the good Java IDE's (which I never considered Eclipse to be).
I like vscode for pretty much everything other than java or c/c++, .net, where the best of breed tooling is far far ahead (intellij and visual studio imho).

It is a great tool though, and made radical and important ripples on the development tooling world.

Glad you changed for better! But it wasn't hard 😝

Collapse
 
samratdebroy profile image
samrat debroy

I have developed both in Eclipse and Intellij and I didn't find Intellij better than Eclipse in any significant way.
May I ask why do you find Intellij "best of breed tooling" and don't consider Eclipse a "good Java IDE"? I am not being sarcastic, I am genuinely curious.
PS: Just today I installed Eclipse 2020-9 and I am definitely finding it at par with Intellij which comes at a cost of $150-200.

Collapse
 
levirs565 profile image
Levi Rizki Saputra

InteliJ have Community Edition that is free too

Collapse
 
mbhatb profile image
Manohar Bhat

Most of the feature wise eclipse is on par with intellij. But it doesn't have proper markdown, asciidoc plugin. The plugin marketplace is slow. Updating Eclipse is not that streamlined etc.

Collapse
 
moratelli profile image
Pedro Moratelli

Agreed. I think VSCode can’t compete with a full fledged IDE like IntelliJ for Java or VS for .NET. It’s alright for everything else but for Java or C#, I need those tools that VSCode just doesn’t offer.

Also, if you’re an Eclipse user, you NEED to try out IntelliJ.

Collapse
 
julbrs profile image
Julien Bras

Yes I will get a try quickly ! thanks !

Collapse
 
_hs_ profile image
HS

IntelliJ lately started freezing and slowing down, but this is in regards to Kotlin. Haven't used Java in couple of months but I guess it would be the same. For some scripting stuff like Apache Camel K, I used VS code for Groovy but I guess having 1 file for each integration would better be with VS Code than IntelliJ as you don't care about indexing and such in these scenarios.

Collapse
 
julbrs profile image
Julien Bras

Sometimes it is hard just because of the habits... I started coding on Java using Eclipse 8 years ago, then changing is very hard. Goal of the article is to try to speak to other Eclipse users ;)

Collapse
 
heikokanzler profile image
Heiko Kanzler 🇪🇺

I am an old bloke, I started with Borlands JBuilder, then moved to Eclipse when it came out and eventually, about 15 years ago, I moved to IntelliJ, mainly because of its great tooling support for Grails. I also use VSCode for my JavaScript projects and I would love to switch completely, especially because VSCode feels so lightweight, but it doesn't really work for me.

As I am doing less Grails projects now, I use VSCode (or even Sublime) for checking older projects, doing quick fixes.

Collapse
 
hasrule profile image
hasruleng

What are the important extensions in VScode to make VScode feel like eclipse?

Collapse
 
hallsamuel90 profile image
Sam Hall • Edited

I made the switch to VSCode about a year ago for java and never looked back. As I am in and out of different languages frequently, it's nice having a uniform development experience.

Through plugins, VSCode offers a robust development environment without the bulk and overhead. It's also just one less thing I have to have on my machine.

I like the integrated terminal as you mentioned and running maven commands instead of relying on gui tools in eclipse, in my opinion has made me a better developer.

There is also the benefit of developing in a virtual environment. I'm honestly not sure if eclipse has this functionality, but with the VSCode remote ssh plugin you can remote into your virtual machine (vagrant box or what have you), develop through VSCode on the host machine and keep your dev environment isolated.

That's my 2 cents anyway 😁

Collapse
 
julbrs profile image
Julien Bras

nice feedback thanks ! I will get a look on this remote ssh plugin !

Collapse
 
xanderyzwich profile image
Corey McCarty

A couple of things that I've found to be really helpful:

I keep my workspace directory that holds project directories. I can have the workspace directory pulled in and VSCode just works without opening specific directories if I want Eclipse style workspace.

Terminal in VSCode can be configured to use GitBash as default. I've found the builtin git tools to be slow and bulky, but having GitBash right there makes it super easy.

I need to figure out how I can get run to function so that I can make it work better for Springboot projects.

Collapse
 
julbrs profile image
Julien Bras

Thanks for the tips !

I haven't yet opened any Sprint Boot project, waiting for your feedback if you have some !

Have a nice day,

Collapse
 
matijao profile image
Matija

How about IntelliJ IDEA?

Collapse
 
julbrs profile image
Julien Bras

Honestly I can't tell. I have spend only a couple of hours on this tool.

Added to my #totest todo list ;)

Collapse
 
linhdoan24 profile image
linhdoan24

vscode missing maven wtp.
on eclipse i can run webapp without build cmd. but in vscode, it have to run mvn package before add to Redhat server.