Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Spring MVC Cookbook

You're reading from   Spring MVC Cookbook Over 40 recipes for creating cloud-ready Java web applications with Spring MVC

Arrow left icon
Product type Paperback
Published in Feb 2016
Last Updated in Feb 2025
Publisher
ISBN-13 9781784396411
Length 466 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Alexandre Bretet Alexandre Bretet
Author Profile Icon Alexandre Bretet
Alexandre Bretet
Alex Bretet Alex Bretet
Author Profile Icon Alex Bretet
Alex Bretet
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Setup Routine for an Enterprise Spring Application FREE CHAPTER 2. Designing a Microservice Architecture with Spring MVC 3. Working with Java Persistence and Entities 4. Building a REST API for a Stateless Architecture 5. Authenticating with Spring MVC 6. Implementing HATEOAS 7. Developing CRUD Operations and Validations 8. Communicating Through WebSockets and STOMP 9. Testing and Troubleshooting Index

Installing Eclipse for JEE Developers and Java SE 8

The following recipe is about downloading and installing the Eclipse IDE for JEE developers and downloading and installing JDK 8 Oracle Hotspot.

Getting ready

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.

How to do it...

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.

  1. Download a distribution of the Eclipse IDE for Java EE developers:

    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.

  2. 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
  3. Select and download JDK 8:

    Note

    To avoid a compatibility issue later on, do stay consistent with the architecture choice (32 or 64 bits) that you have made earlier for the Eclipse archive.

  4. 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:

    1. Execute the downloaded file and wait until you reach the next installation step
    2. 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:

    1. Download the tar.gz archive corresponding to your environment
    2. Change the current directory to where you want to install Java. For easier instructions, let's agree on the /usr/java directory
    3. Move the downloaded tar.gz archive to this current directory
    4. Unpack 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.

How it works…

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.

Eclipse for Java EE developers

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.

Choosing a JVM

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.

Java SE 8

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.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Spring MVC Cookbook
You have been reading a chapter from
Spring MVC Cookbook
Published in: Feb 2016
Publisher:
ISBN-13: 9781784396411
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon