- Mastering Microservices with Java 9(Second Edition)
- Sourabh Sharma
- 572字
- 2021-07-02 21:54:44
NetBeans IDE installation and setup
NetBeans IDE is free and open source and has a big community of users. You can download the NetBeans IDE from its official website, https://netbeans.org/downloads/.
At the time of writing this book, NetBeans for Java 9 was available only as a nightly build (downloadable from http://bits.netbeans.org/download/trunk/nightly/latest/). As shown in the following screenshot, download all the supported NetBeans bundles as we'll use Javascript too:

NetBeans bundles
GlassFish Server and Apache Tomcat are optional. The required packs and runtimes are denoted as Already Installed (as NetBeans was already installed on my system):

NetBeans packs and runtimes
After downloading the installation, execute the installer file. Accept the license agreement as shown in the following screenshot, and follow the rest of the steps to install the NetBeans IDE:

The NetBeans license dialog
JDK 8 or a later version is required for installing and running the All NetBeans bundles. This book uses Java 9, therefore, we would use JDK 9. You can download standalone JDK 9 from http://www.oracle.com/technetwork/java/javase/downloads/index.html. I had to use the JDK 9 early access build because JDK 9 was not released at time of writing the book. It was available at http://jdk.java.net/9/.
Once the NetBeans IDE is installed, start the NetBeans IDE. The NetBeans IDE should look as follows:

The NetBeans start page
Maven and Gradle are both Java build tools. They add dependent libraries to your project, compile your code, set properties, build archives, and do many more related activities. Spring Boot or the Spring Cloud support both Maven and Gradle build tools. However, in this book, we'll use the Maven build tool. Feel free to use Gradle if you prefer.
Maven is already available in the NetBeans IDE. Now, we can start a new Maven project to build our first REST application.
Here are the steps for creating a new empty Maven project:
- Click on New Project (Ctrl + Shift + N) under the File menu. It will open the New Project wizard.
- Select Maven from the Categories list. Then, select POM Project from the Projects list, as shown in following screenshot. Then, click on the Next button.

New Project Wizard
- Now, enter the project name as 6392_chapter2. Also, enter the other properties as shown in the following screenshot. Click on Finish once all the mandatory fields are filled in:

NetBeans Maven project properties
Aggelos Karalias has developed a helpful plugin for the NetBeans IDE offering autocomplete support for Spring Boot configuration properties available at https://github.com/keevosh/nb-springboot-configuration-support. You can download it from his project page at http://keevosh.github.io/nb-springboot-configuration-support/.You could also use the Spring Tool Suite IDE (https://spring.io/tools) from Pivotal instead of the NetBeans IDE. It's a customized all-in-one Eclipse-based distribution that makes application development easy.
After finishing all the preceding steps, NetBeans will display a newly created Maven project. You will use this project for creating the sample rest application using Spring Boot.
- To use Java 9 as a source, set Source/Binary Format to 9, as shown in the following screenshot:

NetBeans Maven project properties - Sources
- Go to Build | Compile and make sure that Java Platform is set as JDK 9 (Default) as follows:

NetBeans Maven project properties - Complile
- Similarly, you can add two new modules named lib and rest in the Modules folder by opening the right-click menu and then selecting the Create New Module option. This time you should select Maven from the Categories list and Java Application from Projects list in New Project dialog box.
- Bootstrap Site Blueprints Volume II
- 從零開始:數(shù)字圖像處理的編程基礎(chǔ)與應(yīng)用
- Building Modern Web Applications Using Angular
- 編程卓越之道(卷3):軟件工程化
- HTML5+CSS3基礎(chǔ)開發(fā)教程(第2版)
- Magento 2 Development Cookbook
- Magento 1.8 Development Cookbook
- 編譯系統(tǒng)透視:圖解編譯原理
- Mastering Linux Network Administration
- 零基礎(chǔ)輕松學(xué)SQL Server 2016
- QGIS By Example
- Python忍者秘籍
- Python Data Science Cookbook
- SQL Server 2008 R2數(shù)據(jù)庫技術(shù)及應(yīng)用(第3版)
- 深入實(shí)踐DDD:以DSL驅(qū)動復(fù)雜軟件開發(fā)