The following recipe is about downloading and installing the Eclipse IDE for JEE developers and downloading and installing JDK 8 Oracle Hotspot.
This first recipe could appear redundant or unnecessary in regard to your education or experience. However, having a uniform configuration all along this book will provide you with many benefits.
For instance, you will certainly avoid unidentified bugs (integration or development). You will also experience the same interfaces as seen in the presented screenshots. Also, because the third-party products are living, you will not have the surprise of encountering unexpected screens or windows.
The whole first chapter in general requires a step by step cooperation. From the next chapter, we will be using GIT and your active involvement will be lightened.
Download a distribution of the Eclipse IDE for Java EE developers:
We will be using an Eclipse Luna distribution in this book. We recommend that you install this version in order to match our guidelines and screenshots completely. Download a Luna distribution for the OS and environment of your choice from https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunasr1.
The product to download is not a compiled installer but a zip archive.
If you feel confident enough to use another version (more recent) of the Eclipse IDE for Java EE Developers, all of them can be found at https://www.eclipse.org/downloads.
Tip
For upcoming installations, on Windows, a few target locations are suggested to be in the root directory (
C:\
). To avoid permission-related issues, it would be better if your Windows user is configured to be a Local Administrator. If you can't be part of this group, feel free to target installation directories you have write access to.
Extract the downloaded archive into an
eclipse
directory from the steps:C:\Users\{system.username}\eclipse
: Extract it here if you are on Windows/home/usr/{system.username}/eclipse
: Extract it here if you are on Linux/Users/{system.username}/eclipse
: Extract it here if you are on Mac OS X
We suggest that you download the Oracle Hotspot JDK. Hotspot is a performant JVM implementation originally built by Sun Microsystems. Now owned by Oracle, the Hotspot JRE and JDK are downloadable for free.
Then, choose the product corresponding to your machine through the Oracle website's link http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html.
Install JDK 8 on the operating system of your choice using the following instructions:
On Windows, this is a monitored installation initiated with an executable file:
Execute the downloaded file and wait until you reach the next installation step
On the installation-step window, pay attention to the destination directory and change it to
C:\java\jdk1.8.X_XX
(X_XX
refers to the latest current version here. We will be using jdk1.8.0_25 in this book. Also, it won't be necessary to install an external JRE, so uncheck the public JRE feature.)
On Linux/Mac, perform the following steps:
Download the
tar.gz
archive corresponding to your environmentChange the current directory to where you want to install Java. For easier instructions, let's agree on the
/usr/java
directoryMove the downloaded
tar.gz
archive to this current directoryUnpack the archive with the following command line targeting the name of your archive:
tar zxvf jdk-8u25-linux-i586.tar.gz
(this example is for a binary archive corresponding to a Linux x86 machine)
You must end up with the /usr/java/jdk1.8.0_25
directory structure that contains the /bin
, /db
, /jre
, /include
subdirectories.
In this section we are going to provide more insights about the version of Eclipse we used and about how we chose this specific version of JVM.
We have successfully installed the Eclipse IDE for Java EE developers here. Comparatively to Eclipse IDE for Java Developers, there are some additional packages coming along such as Java EE Developer Tools, Data Tools Platform, and JavaScript Development Tools. This version is appreciated for its ability to manage development servers as part of the IDE itself, its capability to customize project facets, and its ability to support JPA. The Luna version is officially Java SE 8 compatible; this has been a decisive factor at the time of writing.
The choice of the JVM implementation could be discussed over performance, memory management, garbage collection, and optimization capabilities.
There are lots of different JVM implementations, including couple of open source solutions such as OpenJDK and IcedTea (RedHat). The choice of JVM really depends on the application's requirements. We have chosen Oracle Hotspot from experience and from reference implementations deployed in production; this JVM implementation can be trusted for a wide range of generic purposes. Hotspot also behaves very well if you have to run Java UI applications. Eclipse is one of them.
If you haven't already played with Scala or Clojure, it is time that you took the functional programming train with Java! With Java SE 8, Lambda expressions reduce the amount of code dramatically providing improved readability and maintainability. We won't implement this Java 8 feature, but since it is probably the most popular, it must be highlighted as it has given a massive credit to the paradigm change. It is important, nowadays, to be familiar with these patterns.