Prerequisites
Last updated
Was this helpful?
Last updated
Was this helpful?
Before writing any codes, please install the latest JDK 8, Apache Maven, and your favorate IDE.
Oracle Java 8 is recommended. For Windows user, just go to to download it and install into your system. Redhat has just released a OpenJDK 8 for Windows user at DevNation 2016, if you are stick on the OpenJDK, go to and get it.
Most of the Linux distributions includes the OpenJDK, install it via the Linux package manager.
Optionally, you can set JAVA_HOME environment variable and add <JDK installation dir>/bin in your PATH environment variable.
Type this command in system terminal to verify your Java environment installed correctly.
Download the latest Apache Maven from , and uncompress it into your local system.
Optionally, you can set M2_HOME environment varible, and also do not forget to append <Maven Installation dir>/bin your PATH environment variable.
Type the following command to verify Apache Maven is working.
If you are a Gradle fan, you can use Gradle as build tool. Gradle could be an alternative of Apache Maven.
The source codes are Maven based, it is IDE independent, so you can choose your favorite IDE. Nowadays the popular IDEs includes Eclipse, IDEA, NetBeans.
We will use JPA criteria metadata to provide type safe query, and use Lombok to simplify the codes, you have to enable Annotation Processing feature in your IDEs.
Spring Tool Suite is an Eclipse based IDE, and provides a lot of built-in Spring supports, it is highly recommended for new Spring users.
Extract the files into your local disk. Go to root folder, there is STS.exe file, double click it and starts up Spring Tool Suite.
Go to Windows/Preference menu, and open Preference dialog
Search Annotation
...
Expand Compiler/ Annotation Processing , enable Annotation Processing.
Expand Maven/Annotation Processing, enable Annotation Processing. If it does not exists, install m2e-apt in Maven/Discovery firstly.
Apply all changes.
Go to File / Settings
Search annotation processor
Enable Annotation processing
You can install Lombok plugin from IDEA plugin manager to get Lombok support in your IDEA.
Go to File / Settings / Plugins
Click on Browse repositories...
Search for Lombok Plugin
Click on Install plugin
Restart IDE
For NetBeans users, there is no need to setup Annotation Processing and Lombok, NetBeans has activated Annotation processing capability by default.
In the next posts, let's try to create a project skeleton for our blog sample application.
I would like use Lombok to simply codes and make the codes clean. Go to to get know with Lombok.
There is a good from baeldung's blog.
Go to , download a copy of . At the moment, the latest version is 3.8.
Alternatively, you can download a copy of Eclipse Java EE bundle from , and install the STS plugin from Eclipse Marketplace.
Go to Lombok project website, and follow the official ) to install Lombok plugin into your Eclipse IDE.
No doubt, is the most productive Java IDE. It includes free and open source community version and enterprise version.
is the simplest IDE for Java development, which was originally brought by Sun microsystem(and later maintained by Oracle), it is free and open source.
Now Oracle denoted it as .
Download a copy of NetBeans from (it is still working before Apache hand over it).