Installation
There are generally three ways to install Eclipse:
- Manually from Eclipse Downloads
- Via a package manager (snapcraft, pacman, etc.)
- The Eclipse Installer
Recommended installation locations
On Linux:
/home/shadylady/tools/eclipse/eclipse-java
/opt/eclipse
(according to Linux#Manualsoftwareinstallation)/usr/lib/eclipse
(This is only if installed by an official system package manager)
On Windows:
C:\ProgramData\eclipse\eclipse-java
Workspaces
It is not recommended to put your code in a workspace directory. A "workspace" in Eclipse is more akin to isolated or "portable" application settings; not a place to store projects.
It is highly discouraged to put code in an Eclipse workspace folder.
Potential workspace locations:
~/tools/eclipse/workspace
(Linux)~/.config/eclipse/workspace
C:\ProgramData\eclipse\workspace
(Windows)
Configuration
Application memory
Eclipse will perform terribly unless you give it a few GB of memory (RAM).
In the installation folder, find eclipse.ini
. Ensure is contains the following JVM options:
-Xms512m -Xmx2g
The values above are just an example. Scale them to fit your needs. See the official eclipse.ini documentation.
The settings will take effect upon the next restart of Eclipse.
Create a desktop launcher
If Eclipse was installed manually, you'll want to create a desktop application launcher or shortcut. See Linux#Desktopentries.
An example eclipse.desktop
file in Linux you could put in ~/.local/share/applications/
:
[Desktop Entry] Name=Eclipse Comment=Java Development Environment Icon=eclipse Exec=eclipse Terminal=false Type=Application Categories=Development;IDE;Java; StartupNotify=true
Disable Welcome menu
To disable the Welcome menu from consuming the full application screen on startup:
- Clear "Always show Welcome at start up" at the bottom right corner of the Welcome menu.
General settings
In Window > Preferences > General:
- Set "Show heap status"
Editor settings
In Window > Preferences > General > Editors
Text Editors:
- Set "Displayed tab width" to "3"
- In "Spelling", clear "Enable spell checking"
Workspace settings
In Window > Preferences > General > Workspace:
- Set "Refresh using native hooks or polling"
- Set "Show full workspace path"
- Set "Text file encoding" to "UTF-8"
- Set "New text file line delimiter" to "Unix"
- In "Build", set "Save automatically before build"
Gradle settings
In Window >Preferences > Gradle:
- Set "Gradle distribution" to "Local installation directory" and point to your local Gradle installation
Java settings
In Window > Preferences > Java:
Compiler > Error/Warnings > Deprecated and restricted API:
- Set "Forbidden reference (access rules)" to "Ignore"
Editor > Content Assist > Favorites:
- Click "New Type..." and add "
org.junit.jupiter.api.Assertions
"
Editor > Templates:
TODO
Create some updated templates for LogTools, JUnit 5, etc.
Code Style > Formatter:
- Click "Import..." and import IHMC Open Robotics Software/ihmc-java-toolkit/CodeFormatTemplates/IHMCEclipseFormatter.xml
Plugins
JavaFX
To get JavaFX to work in Eclipse, a plugin is presently required. Follow the instructions to install e(fx)clipse.
C++ development
CMake editor: http://www.cthing.com/CMakeEd.asp
Eclipse file generator from CMake: https://gitlab.kitware.com/cmake/community/wikis/doc/editors/Eclipse-CDT4-Generator
EGit
Install Egit: http://www.eclipse.org/egit/download/
Set Git default Pull to 'rebase' as described in Git Tips And Tricks
In Window > Preferences > Team > Git > History:
- Set "Maximum characters to show for a tag" to 100
- Set "Maximum characters to show for a branch" to 100
Importing Gradle Projects
- Select File > Import...
- Select the "Gradle > Existing Gradle Project" import wizard
- Clear "Show the welcome page the next time the wizard appears"
- Set the "Project root directory"
- Select "Override workspace settings"
- Select "Local installation directory" and set it to your local Gradle installation
- Set "Show Console View"
- Set "Show Executions View"
- (passive) Check that a tree populates on the "Import Preview" page
See also
TODO: How to run Gradle tasks with custom options