Eclipse Can Do That!?
There’s a good reason Eclipse has remained the most popular Java IDE for all these years. There’s so much cool stuff you get in Eclipse, and even more when you add plugins! Take a look at some favorite Eclipse tips. Have a favorite that didn’t make the list? Let us know!
Java Debug Return Values
Test Source Folders
A source folder can be configured as one that “contains test sources”. This allows you to control how the folder is displayed, whether test code is visible in your primary code or by other projects, and even have separate test-only dependencies.
Can’t remember what the difference is between > and ~ when working with CSS selectors? Fret not, hover over a selector to see an instant preview of the elements it would target—very handy when dealing with complex selectors and advanced CSS syntax!
Java 10 introduced var support. Hover over a local variable declared with var to instantly see the actual type. Use the quick fix action to convert the declaration to use the actual type, or vice-versa.
Git Revision History
Do you need to know exactly how a file in a Git repository has changed? Use the History view, or display revision information directly in the editor, colored by author/date as required.
For a truly dark Eclipse experience, across all operating systems, try either the Darkest Dark or Deep Black theme—both included with the DevStyle plugin. If you’re not a dark fan, there is a collection of fresh, light themes too. Dark or light, all themes have unique, customizable icon sets, as well as a number of editor color sets to choose from.
Remote System Explorer
If you need to deal with remote systems, use the Remote System Explorer. It supports SSH, FTP, Telnet, and several other OS-specific protocols. Manipulate files, and even launch a remote shell, without leaving the IDE.
Emmet is fantastic for quick abbreviation expansion, but did you know that is just a snippet of what Emmet commands can do? Use Emmet to create lists, update image sizes, do some math, and much more!
Use a Launch Group to launch multiple configurations with a single click. You can set up each configuration to simply launch sequentially, wait for the previous launch to terminate, emit specific output, etc., before launching.
Don’t waste time stepping through code when you don’t have to. Create a Trigger Point to skip breakpoints, until the trigger point itself is hit. Watch points can now have conditions, ensuring that execution is suspended only when the specified condition is met.
Use IntelliSense in your package.json files to get recommendations for Node module names and versions. So if you can’t remember a module name, or want to upgrade your modules, this capability makes it super convenient.
With Code Recommenders, content assist suggestions are ordered based on what other developers have called in a similar context—no more alphabetical suggestions to sift through! There’s a lot more that Code Recommenders can do—including advanced templatized snippets for most file types using the Snipmatch snippet engine.
The Debug Console can be a significant debugging asset. Use this to inspect, or even modify values during your debugging session. If you’re debugging Java, these capabilities are present in the Debug Shell view (a.k.a. Display view prior to Eclipse Photon).
It’s no secret that running your code through a static analyzer can vastly improve its quality. Spotbugs (formerly Findbugs), Checkstyle, and PMD, are well known static analyzers for Java, all of which have Eclipse integrations.
With these plugins, you can see potential problems reported in the IDE itself, allowing you to navigate to, and correct issues easily—some can even be corrected with Quick Fixes!
Emacs and Vi Power
Is the potential loss of key bindings and commands the only thing stopping you from moving from Emacs or Vi to a full blown IDE like Eclipse?
Use the Emacs+ or Vrapper plugins to give you access to these same powerful capabilities in any Eclipse editor. And we’re not just talking about key bindings, commands work as well.
Preview on Hover
You don’t need to jump between source files to see how a method is implemented, or a field defined. Press Shift (Java) or Ctrl (CodeMix supported languages) when hovering over your code, to peek at the definition without leaving your current editing context!
Advanced Source Lookup & Decompilers
Even if you don’t have the source attached while debugging a Java application, the JDT’s “Advanced Source Lookup”, is capable of finding and attaching the source for you—even downloading it from remote repositories if required.
If the JDT can’t find it, there’s always the Enhanced Class Decompiler, which can use a Java decompilation engine of your choice to seamlessly deliver source you can step through.
Help Us Improve This List of Eclipse Tips!
With so many cool ways to use Eclipse, we’re sure our list of Eclipse tips is incomplete. If you have a tip you’d like to see added, we’d love to hear from you. Send us an email! email@example.com