---
title: "Java and Eclipse on Ubuntu"
description: "How to install Java JDK/JRE and Eclipse on Ubuntu. Practical notes and code examples on Java and Eclipse on Ubuntu by in JS."
url: "https://h3manth.com/scribe/java-and-eclipse-on-ubuntu/"
canonical_url: "https://h3manth.com/scribe/java-and-eclipse-on-ubuntu/"
markdown_url: "https://h3manth.com/scribe/blog/java-and-eclipse-on-ubuntu.md"
publishDate: "2008-11-27T00:00:00.000Z"
author: "Hemanth HM"
category: "cli"
tags: ["java","linux"]
word_count: 134
reading_time_minutes: 1
x_markdown_tokens: 435
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Java and Eclipse on Ubuntu

> How to install Java JDK/JRE and Eclipse on Ubuntu. Practical notes and code examples on Java and Eclipse on Ubuntu by in JS.

## Java

**JDK:** [Download here](http://mirrors.kernel.org/ubuntu/pool/multiverse/s/sun-java6/sun-java6-jdk_6-06-0ubuntu1_i386.deb)

**JRE:**

```bash
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
```

## Eclipse

**Download and extract:**

```bash
cd /opt/
wget http://ganymede-mirror1.eclipse.org/technology/epp/downloads/release/ganymede/R/eclipse-jee-ganymede-linux-gtk.tar.gz
tar xvfz eclipse-jee-ganymede-linux-gtk.tar.gz
```

**Finalizing Eclipse:**

```bash
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
sudo chmod +x $(sudo find eclipse -type d)

sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudo gedit /usr/bin/eclipse
```

**Paste the below, save and exit:**

```bash
#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*
```

**Make a launcher:**

```bash
sudo gedit /usr/share/applications/eclipse.desktop
```

**Paste the below, save and exit:**

```ini
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
```

**Launch Eclipse:**

```bash
eclipse -clean
```

P.S: The icon may fail to load, try alternative shortcut methods. From the next launch you can do it from **Applications** >> **Programming** >> **Eclipse**.
