Install git and oracle java8 on Ubuntu Server

Continuing this Ubuntu CI Server series, we will install git and oracle java8.
This will be a quick one!

Articles in the Ubuntu Continuous Integration (CI) Setup Series:

  1. Create an ubuntu server installation usb flash drive
  2. Install ubuntu server
  3. Install git and oracle java8 on Ubuntu Server

Install git

Connect to the ubuntu server via ssh, we’ve covered how to do this here.

At the command prompt ($) type:
$ sudo apt-get install git
// You may have to accept (press Y) the installation of new packages.

git_00
Installing git.

The setup git global settings:
$ git config –global user.name “userver”
$ git config –global user.email “[your-email-address-goes-here]”

Install oracle java8

Ubuntu Server comes with a version of the OpenJDK Runtime Environment (JRE), but for our purposes we want to install the Java Development Kit (JDK) for compiling java code. We will install Oracle’s Java8 JDK (and as a result this will update the JRE too).

git_01
The version of the JRE that comes with Ubuntu Server and the available JDKs that can be installed.

As you can see in the image above, oracle java8 is not an available option. That is the repository where oracle java8lies in is not available as standard to Ubuntu Server, so lets add it:
// Lets add the new repository (You may have to press enter to accept a message)
$ sudo add-apt-repository ppa:webupd8team/java
// Refresh the list of packages in the repositories
$ sudo apt-get update
// Install oracle java8
$ sudo apt-get install oracle-java8-installer

git_02
You may have to press Y and enter to continue.

Here you will have to accept the license to continue installation

git_03
Read the license if you wish and press enter here to continue.

git_04
If you accept the license, go to YES and press enter to continue.

We can now check the currently installed version of the JRE and JDK as we did before:

git_05
Check the version of the JRE and JDK just installed.

An extra recommended step is to install the oracle-java8-set-default to set the environment variables for java on the system:
$ sudo apt-get install oracle-java8-set-default

git_06
Installing the oracle-java8-set-default to set java environment variables.

Install java reference: http://tecadmin.net/install-oracle-java-8-jdk-8-ubuntu-via-ppa/

Installing ant and required external library dependencies

To install ant in ubuntu, simply:
$ sudo apt-get install ant

Depending on what you are doing with your ant scripts you might need to copy extra libraries.
The FTP ant task, requires the following library: commons-net.jar
I’ve also copied javax.mail.jar I think because of mail tasks that I run.
I’ve downloaded commons-net-3.4.jar and javax.mail-1.5.5.jar and copied them to
/usr/share/ant/lib/
Leave owner as root
(All other libs are in this dir as symbolic links…)

black-circuit-512

 

Articles in the Ubuntu Continuous Integration (CI) Setup Series:

  1. Create an ubuntu server installation usb flash drive
  2. Install ubuntu server
  3. Install git and oracle java8 on Ubuntu Server

Leave a Reply

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