Before writing any codes, please install the latest JDK 8, Apache Maven, and your favorate IDE.
Java 8
Oracle Java 8 is recommended. For Windows user, just go to Oracle Java website 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 Redhat Developers website 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.
#java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
Apache Maven
Download the latest Apache Maven from http://maven.apache.org, 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.
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 ToolSuite
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.
Expand Maven/Annotation Processing, enable Annotation Processing. If it does not exists, install m2e-apt in Maven/Discovery firstly.
Apply all changes.
Go to Lombok project website, and follow the official the installation guideline) to install Lombok plugin into your Eclipse IDE.
Intellij IDEA
No doubt, Intellij IDEA is the most productive Java IDE. It includes free and open source community version and enterprise version.
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
NetBeans
NetBeans 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.