Eclipse IDE — Choosing it wisely

Daniel Maioni
5 min readMar 24, 2023

--

Here we gonna learn which Eclipse version choose and setup.

  1. Version

Go to the eclipse comparison page, and take a look on what package is best convenience for you: https://www.eclipse.org/downloads/packages/compare

Example:

  • for program development: “Eclipse IDE for Java Developers”
  • for developing web apps: “Eclipse IDE for Java EE Developers”
  • Java : “Eclipse IDE for Java Developers” (JavaSE) or “Eclipse IDE for Java EE Developers” (JavaEE). You need to first install JDK, click here to know how.
  • for PHP: “Eclipse IDE for PHP Developer”
  • for C/C++: “Eclipse IDE for C/C++ Developers”
  • After decide it, download that package at https://www.eclipse.org/downloads for your system — it could be available at your Linux shop store (snap / flatpak)

2. Download

So, let’s get the Enterprise Java/Web “Eclipse IDE for Java and Web Developers” for Linux x86_64

3. Install

Download it and extract it to /usr/bin :

wget https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2023-03/R/eclipse-jee-2023-03-R-linux-gtk-x86_64.tar.gz -P /tmp
sudo tar xf /tmp/eclipse-*.tar.gz -C /usr/local

or /opt

wget https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2023-03/R/eclipse-jee-2023-03-R-linux-gtk-x86_64.tar.gz -P /tmp
sudo tar xf /tmp/eclipse-*.tar.gz -C /opt

4. Setup

Create a symbolic link to eclipse with the command ln adding the parameters s (symbolic) f (force) and n (no-dereference):

sudo ln -sf /usr/local/eclipse/eclipse /usr/bin/eclipse
ls -ld /usr/bin/eclipse
which eclipse

or /opt

sudo ln -sf /opt/eclipse/eclipse /usr/bin/eclipse
ls -ld /usr/bin/eclipse
which eclipse

5. Update IDE

Open eclipse with eclipse command line and update the IDE:

Help > Check for Updates > Install Updates > Agree > Trust > Reload

6. Update tools

Make sure those tools are installed…

Help > Eclipse Marketplace… > Installed

— Essential tools for Java developer, including a Java IDE, a Git client, XML Editor, Maven and Gradle integration:

  • Git integration for Eclipse
  • Eclipse Java Development Tools
  • Maven Integration for Eclipse
  • Gradle Integration

click here to know how to install Maven.

click here to know how to install Gradle.

— Essential tools for developers working with Java and Web applications, including a Java IDE, tools for JavaScript, TypeScript, JavaServer Pages and Faces, Yaml, Markdown, Web Services, JPA and Data Tools, Maven and Gradle, Git, and more.

  • Data Tools Platform
  • Git integration for Eclipse
  • Eclipse Java Development Tools
  • Eclipse Java EE Developer Tools
  • Maven Integration for Eclipse
  • Eclipse Plug-in Development Environment

— Essential tools for developers working with C/C++ applications, including a Java IDE, tools for JavaScript, TypeScript, JavaServer Pages and Faces, Yaml, Markdown, Web Services, JPA and Data Tools, Maven and Gradle, Git, and more.

  • C/C++ Development Tools
  • Git integration for Eclipse

— Essential tools for developers working with PHP, including PHP language support, Git client and editors for JavaScript, TypeScript, HTML, CSS and XML.

  • Git integration for Eclipse
  • PHP Development Tools (PDT)
  • Eclipse XML Editors and Tools

… otherwise install them:

Help > Eclipse Marketplace… > popular > Install > Agree > Trust > Reload
Eclipse 2023–03 splash screen
Eclipse is ready!

7. Fix Eclipse (after a bad update)

Find you Eclipse install location folder

/home/popos/.var/app/org.eclipse.Javascript/eclipse/eclipse

Remove the cache folder

rm -rf /home/popos/.var/app/org.eclipse.Javascript/eclipse/eclipse/.p2/org.eclipse.equinox.p2.repository/cache

Reboot eclipse:

cd /home/popos/.var/app/org.eclipse.Javascript/eclipse/eclipse/
./eclipse & disown

Config file:

cat /home/popos/.var/app/org.eclipse.Javascript/eclipse/eclipse/configuration/config.init

#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Thu Jun 06 13:52:57 UTC 2024
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=4.32.0.20240606-1231
eclipse.p2.data.area=@config.dir/../p2
eclipse.p2.profile=epp.package.jee
eclipse.product=org.eclipse.epp.package.jee.product
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.5.300.v20240424-1301.jar@1\:start
osgi.bundles.defaultStartLevel=4
osgi.framework=file\:plugins/org.eclipse.osgi_3.20.0.v20240509-1421.jar
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.2.1000.v20240213-1057.jar
osgi.instance.area.default=@user.home/workspace
osgi.splashPath=platform\:/base/plugins/org.eclipse.epp.package.common

It`s also possible to manual update Eclipse, just download and extract version to /home/popos/.var/app/org.eclipse.Javascript/eclipse/eclipse/ ad overright files.

Plugins will need to be reinstalled!

8. New Java Project

  1. Launch eclipse
  2. Choose an workspace folder/home/$USER/eclipse_workspace
  3. Create a new “Java Project”
  4. Choose “File” menu ⇒ “New” ⇒ “Java project” (or “File” ⇒ “New” ⇒ “Project” ⇒ “Java project”).
  5. “Project name”, enter “FirstProject".
  6. Check “Use default location”.
  7. In “JRE”, check “Use an execution environment JRE” and select “JavaSE-18"
  8. Still in “JRE”, click in “Configure JREs” and select the compiler level to make sure the workspace compiler has the same version as the JRE select at previous step.
  9. In “Project Layout”, check “Use project folder as root for sources and class files”.
  10. In “Module”, UNCHECK “Create module-info.java” file.
  11. Push “Finish” button.
  12. IF “Create module-info.java” dialog appears, Click “Don’t Create” (This will not appear if you do step 2(e)).

9. Write a Hello-world Java Program (or “Java Class”)

  1. In the “Package Explorer” (left pane) ⇒ Right-click on “FirstProject" (or use the "File" menu) ⇒ New ⇒ Class.
  2. The “New Java Class” dialog pops up.
  3. In “Source folder”, keep the “FirstProject”.
  4. In “Package”, leave it EMPTY. Delete the content if it is not empty.
  5. In “Name”, enter “Hello".
  6. Check “public static void main(String[] args)".
  7. Don’t change the rest.
  8. Push “Finish” button.
  9. The source file “Hello.java" opens on the editor pane (the center pane). Enter the following codes:
public class Hello {
public static void main(String[] args) {
System.out.println("hello, world");
}
}

10. Compile & Execute the Java Program

  1. There is no need to compile the Java source file in Eclipse explicitly. It is because Eclipse performs the so-called incremental compilation, i.e., the Java statement is compiled as and when it is entered.
  2. To run the program, right-click anywhere on the source file “Hello.java" (or choose "Run" menu) ⇒ Run As ⇒ Java Application.
  3. The output “Hello, world!” appears on the Console pane (the bottom pane).
“Hello World.” printed on console
Hello world on console

To change the JRE for any reason…

A: Configure the Build path in the “Package Explorer” (left pane) ⇒ Right-click on “JRE System Library" ⇒ Build Path ⇒ Configure. (or “Package Explorer” (left pane) ⇒ Right-click on “FirstProject" ⇒ Build Path ⇒ Properties ⇒ Java Build Path).

  1. The “Properties for FirstProject” dialog pops up.
  2. In “Libraries folder”, select the JRE System Library”. Select Edit…
  3. In “System library”, leave it EMPTY. Delete the content if it is not empty.
  4. In “Name”, enter “Hello".
  5. Check “public static void main(String[] args)".
  6. Don’t change the rest.
  7. Push “Finish” button, select the Execution environment: JavaSE-11 (jre)
  8. Push “Finish” button.
  9. Push “Apply and Close” button.

B: Compiler level

  1. Depends on your project target JVM, specify the compiler level
  2. Choose “Windows” menu ⇒ “Preferences” ⇒ “Java” ⇒ “Compiler”.
  3. And change the “Compiler compliance level”, to the specified JVM your project has as a target version. Let it unchanged for now.

IT’s my problems, maybe yours…

--

--