Spring MVC Fast Tutorial: installation on Ubuntu

We will install:

  • Java 8
  • Maven 3: a build tool, similar to Ant but with better dependency management.
  • Tomcat 8: a Java web server
  • Eclipse: an IDE

Installing Java

  • Add this PPA (Personal Package Archive):
sudo add-apt-repository -y ppa:webupd8team/java
  • Refresh the list of available packages:
sudo apt-get update
  • Download and install Java 8:
sudo apt-get -y install oracle-java8-installer
  • Test whether it's working:
java -version
  • You should get something like:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

Installing Maven

  • On the Apache website, download the Binary zip of the current version.

  • Uncompress and move the folder to a convenient location (for example: ~/bin).
  • In your ~/.bash_profile file, add a MAVEN HOME environment variable pointing to that folder. For example:
export MAVEN_HOME=~/bin/apache-maven-3.3.1
  • Add the bin subfolder to your PATH environment variable:
export PATH=$PATH:$MAVEN_HOME/bin
  • Open a new terminal and test that it's working:
$ mvn –v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T09:29:23-08:00)
Maven home: /Users/jlj7/bin/apache-maven-3.2.5
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac"

Installing Tomcat

  • On the Apache website, under Binary distributions, under Core, download the zip file.

  • Uncompress and move the folder to a convenient location (for example: ~/bin).
  • Make the scripts in the bin subfolder executable:
chmod +x bin/*.sh
  • Launch Tomcat using the catalina.sh script:
$ bin/catalina.sh run
Using CATALINA_BASE: /Users/jerome/bin/apache-tomcat-8.0.20
...
INFO: Server startup in 852 ms

Installing Eclipse

  • On the Eclipse website, choose the 64 Bit version of Eclipse IDE for Java EE Developers (:!: not Eclipse IDE for Java Developers)

  • Uncompress and move the folder to a convenient location (for example: ~/bin).
  • Launch Eclipse by executing the eclipse binary:
./eclipse

Next: Hello, World!
Up: Spring MVC Fast Tutorial

Feedback

bravo this is very well done;
just a remark ; stay with JDK 1.7 because the ecilpse package is not ready for 1.8 or 1.9
bernis
Jun 4, 2015
#1
hey bro can u help me, how can i know the which java to install?
jrosales@ula.ve
Jesus
May 26, 2016
#2
sudo apt-get install –y oracle-java8-installer

above does not work.

sudo apt-get install –y oracle-java-8-installer

above worked.
Jim
Aug 3, 2016
#3
Jim, there was a typo with the position of -y that I just fixed, but the package is oracle-java8-installer. See http://www.ubuntuupdates.org/ppa/webupd8_java.
Jérôme Jaglale
Aug 3, 2016
#4