How To: Install Git, Maven and Eclipse on Elementary OS
In a previous post, I wrote about installing the eXo Platform (Community Edition) on Elementary OS, now that I have the eXo Platform up and running there are a few more tasks that I need to complete in order to build the eXo Platform using Maven.
In this post, we'll install:
- Git
- Maven
- The Eclipse IDE for Java EE Developers
Prerequisites
Install Git
Before we install Git, its always a good idea to check for updates. So lets open a terminal session and run the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get check
sudo apt-get autoclean
Now to install Git, enter the following command:
sudo apt-get install git
After you have installed Git, you can check the version by running the following command:
git --version
You should then see output like:
git version 1.9.1
Install Maven
To install Maven, enter the following commands:
sudo apt-get purge maven maven2 maven3
sudo apt-add-repository ppa:andrei-pozolotin/maven3
sudo apt-get update
sudo apt-get install maven3
After you have installed Maven, you can check the version by running the following command:
mvn --version
You should then see output like:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T03:41:47+11:00)
Maven home: /usr/share/maven3
Java version: 1.7.0_95, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-56-generic", arch: "amd64", family: "unix"
Note: Don't forget to set the M2_HOME and M2 environment variables and to update your PATH in your .bashrc
file (.bashrc is a shell script that Bash runs whenever it is started interactively):
export M2_HOME=/usr/share/maven3
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
Install Eclipse
First, we need to download Eclipse:
I downloaded the Eclipse IDE for Java EE Developers for Linux 64 bit (Mars.2 - 4.5.2):
eclipse-jee-mars-2-linux-gtk-x86_64.tar.gz
Now, we just need to unpack the file, in the /opt
folder:
cd /opt/ && sudo tar -zxvf ~/Downloads/eclipse-*.tar.gz
For easy access to Eclipse, lets create a launcher shortcut:
sudo nano /usr/share/applications/eclipse.desktop
With the following contents:
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse Mars
Comment=Integrated Development Environment
Exec=/opt/eclipse/eclipse -vm /usr/lib/jvm/java-7-openjdk-amd64/bin
Icon=/opt/eclipse/icon.xpm
Categories=Application;Development;Java;IDE
Type=Application
Terminal=false
The Applications launcher:
Note: You also need to update eclipse.ini
:
sudo nano /opt/eclipse/eclipse.ini
and add the following lines before --launcher.appendVmargs
:
...
--launcher.GTK_version
2
...
Now you can launch Eclipse:
References:
- Stackoverflow: How to install Maven 3 on Ubuntu
- Stackoverflow: Eclipse Mars freezes after splash screen