How to Install Eclipse on Ubuntu?

how to install eclipse on ubuntu

Eclipse is one of the most popular Integrated Development Environments (IDEs) for Java, C/C++, Python, and other programming languages. Whether you’re a student, a developer, or a hobbyist, setting up Eclipse on Ubuntu can streamline your coding workflow.

This guide provides three easy methods to install Eclipse on Ubuntu, ensuring you can choose the best approach for your needs. By the end, you’ll have Eclipse up and running, ready for your next project!

Prerequisites

Before installing Eclipse, ensure your Ubuntu system meets these requirements:

  • Ubuntu 20.04 LTS or later (recommended for better compatibility)
  • Java Development Kit (JDK) 11 or newer (Eclipse requires Java)
  • At least 2GB RAM (4GB+ recommended for smoother performance)
  • 5GB of free disk space

Step 1: Install Java (JDK)

Since Eclipse runs on Java, you must install the Java Development Kit (JDK) first.

Option 1: Install OpenJDK (Recommended)

OpenJDK is a free and open-source implementation of Java.

  1. Update your package list:
   sudo apt update
  1. Install OpenJDK 11 (or newer):
   sudo apt install openjdk-11-jdk
  1. Verify the installation:
   java -version

You should see output like:

   openjdk version "11.0.22" 2024-01-16
   OpenJDK Runtime Environment (build 11.0.22+7-post-Ubuntu-0ubuntu222.04.1)
   OpenJDK 64-Bit Server VM (build 11.0.22+7-post-Ubuntu-0ubuntu222.04.1, mixed mode, sharing)

Option 2: Install Oracle JDK (Alternative)

If you prefer Oracle’s official JDK:

  1. Add the Oracle repository:
   sudo add-apt-repository ppa:linuxuprising/java
   sudo apt update
  1. Install Oracle JDK 17:
   sudo apt install oracle-java17-installer
  1. Verify the installation:
   java -version
how to install eclipse on ubuntu

Method 1: Install Eclipse via Snap (Easiest Method)

Snap is Ubuntu’s universal package manager, making installation quick and hassle-free.

  1. Run the following command:
   sudo snap install --classic eclipse
  1. Wait for the installation to complete.
  2. Launch Eclipse from the terminal or Ubuntu’s application menu.

Pros:

  • Automatic updates
  • No manual dependency management

Cons:

  • Slightly slower startup time (Snap packages run in a sandbox)

Method 2: Install Eclipse Using .deb Package (Official Method)

For users who prefer traditional .deb packages:

  1. Download Eclipse IDE from the official website.
  • Choose the appropriate version (e.g., Eclipse IDE for Java Developers).
  1. Extract the downloaded .tar.gz file:
   tar -xvzf eclipse-*.tar.gz -C ~/
  1. Move Eclipse to /opt (Optional but recommended for system-wide installation):
   sudo mv ~/eclipse /opt/
  1. Create a desktop shortcut:
  • Run:
    bash sudo nano /usr/share/applications/eclipse.desktop
  • Paste the following content:
    ini [Desktop Entry] Name=Eclipse IDE Type=Application Exec=/opt/eclipse/eclipse Terminal=false Icon=/opt/eclipse/icon.xpm Comment=Integrated Development Environment Categories=Development;IDE;
  • Save (Ctrl+O) and exit (Ctrl+X).
  1. Make the shortcut executable:
   sudo chmod +x /usr/share/applications/eclipse.desktop
  1. Launch Eclipse from the Applications menu.

Pros:

  • Full control over installation
  • No Snap overhead

Cons:

  • Manual updates required

Method 3: Install Eclipse via Ubuntu Software Center (GUI Method)

For users who prefer a graphical approach:

  1. Open Ubuntu Software Center.
  2. Search for “Eclipse IDE”.
  3. Click Install.

This method is user-friendly but may not always have the latest version.

Post-Installation Setup

1. Create a Workspace

Eclipse will prompt you to select a workspace (a folder for your projects). Choose a convenient location.

2. Install Plugins (Optional)

Eclipse supports plugins for additional languages and tools:

  • For C/C++: Install Eclipse CDT via Help > Eclipse Marketplace.
  • For Python: Install PyDev from the marketplace.

3. Configure Java Path (If Needed)

If Eclipse doesn’t detect Java:

  1. Go to Window > Preferences > Java > Installed JREs.
  2. Click Add, then browse to your JDK path (e.g., /usr/lib/jvm/java-11-openjdk-amd64).

Troubleshooting Common Issues

1. Eclipse Won’t Launch

  • Ensure Java is installed (java -version).
  • Try running Eclipse from the terminal for error logs:
  /opt/eclipse/eclipse

2. Slow Performance

  • Increase Eclipse’s memory allocation by editing eclipse.ini (inside Eclipse’s installation folder):
  -Xms1024m
  -Xmx2048m

3. Missing Icons or Shortcuts

  • Recreate the .desktop file (Method 2, Step 4).

Conclusion

Install Eclipse on Ubuntu is straightforward with multiple methods available. Whether you prefer Snap for simplicity, .deb for control, or the Ubuntu Software Center for a GUI approach, you now have a fully functional IDE ready for development.

🔹 Got questions? Drop a comment below!
🔹 Found this helpful? Share it with fellow developers!

Happy coding! 🚀 Read Also : How to Install Telegram on Ubuntu?

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top