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 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.
Folder presentation in VSCode
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).
The global experience is very good.
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.
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.
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.
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.
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.
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.
So just an advice: get a try on one of your Java project, you may be surprised to change your habits !
Top comments (16)
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 😝
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.
InteliJ have Community Edition that is free too
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.
Yes I will get a try quickly ! thanks !
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.
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 ;)
As I am doing less Grails projects now, I use VSCode (or even Sublime) for checking older projects, doing quick fixes.
What are the important extensions in VScode to make VScode feel like eclipse?
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 😁
nice feedback thanks ! I will get a look on this remote ssh plugin !
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.
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,
How about IntelliJ IDEA?
Honestly I can't tell. I have spend only a couple of hours on this tool.
Added to my #totest todo list ;)