There are generally three ways to install Eclipse:
Also see the official installation guide.
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)/snap/eclipse/current
(If installed via snap
)On Windows:
C:\ProgramData\eclipse\eclipse-java
Eclipse is launched with settings specified in an INI file in the installation directory called eclipse.ini. See the official eclipse.ini documentation. Changes to the INI file will take effect upon the next restart of Eclipse.
There is no way to edit eclipse.ini when Eclipse is installed via snap. Workarounds include:
--launcher.ini /path/to/eclipse.ini
option.-vmargs -Xms1g -Xmx3g
to the launcher.Eclipse 2020+ requires to run with a Java 11 VM or higher. If you need to set which JRE Eclipse runs with, add the following lines to the eclipse.ini.
-vm /path/to/jdk |
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)Eclipse will perform terribly unless you give it a few GB of memory (RAM).
Ensure the eclipse.ini contains the following JVM options:
-Xms512m -Xmx2g |
The values above are just an example. Scale them to fit your needs.
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=/opt/eclipse/icon.xpm Exec=/opt/eclipse/eclipse Terminal=false Type=Application Categories=Development;IDE;Java; StartupNotify=true |
To disable the Welcome menu from consuming the full application screen on startup:
In Window > Preferences > General:
In Window > Preferences > General > Editors
Text Editors:
In Window > Preferences > General > Workspace:
Expand Workspace > Build. Set "Save automatically before build"
Default Gradle settings in Eclipse are currently broken so you must "Override workspace settings" every time. See Github issue. |
In Window >Preferences > Gradle:
In Window > Preferences > Java:
Code Style > Formatter:
Compiler > Error/Warnings > Deprecated and restricted API:
Editor > Content Assist > Favorites:
org.junit.jupiter.api.Assertions
"In Editor > Templates:
Create some updated templates for LogTools, JUnit 5, etc. |
See also the page on Java.
In Java > Installed JREs, add any manually installed JREs. (i.e. Zulu in the /opt/zulu directory)
Check to make sure the jfxrt.jar
is present for JavaFX to work.
In the "Edit JRE" dialog, expand the *.jar entries and check if a Source attachement is detected. These should be detected automatically.
To get JavaFX to work in Eclipse, a plugin is presently required. Follow the instructions to install e(fx)clipse:
This plugin provides nice log level coloring in the console as supported by IHMC's Log Tools library.
Search "ansi console" in the Marketplace and install ANSI Escape in Console by Mihai Nita.
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
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:
Default Gradle settings in Eclipse are currently broken so you must "Override workspace settings" every time. |
/usr/share/java/gradle
, /opt/gradle
, and C:\gradle
)General troubleshooting steps for Eclipse are:
It might be best to delete projects in Eclipse before deleting them on disk. Else your workspace might get corrupted if you try to delete from the File Explorer.
Sometimes Eclipse will "forget" part of it's classpath. Recommended solution: Refresh Gradle Project
Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: com/martiansoftware/jsap/JSAPException at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) Caused by: java.lang.ClassNotFoundException: com.martiansoftware.jsap.JSAPException at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 7 more |
TODO: How to run Gradle tasks with custom options