We have taken a quick look at some of the new language features we will be using. We have also seen a quick overview of the projects we will be building. One final question remains: what tools will we be using to do our work?
The Java ecosystem suffers from an embarrassment of riches when it comes to development tools, so we have much to choose from. The most fundamental choice facing us is the build tool. For our work here, we will be using Maven. While there is a strong and vocal community that would advocate Gradle, Maven seems to be the most common build tool at the moment, and seems to have more robust, mature, and native support from the major IDEs. If you do not have Maven already installed, you can visit http://maven.apache.org and download the distribution for your operating system, or use whatever package management system is supported by your OS.
For the IDE, all screenshots, directions, and so forth will be using NetBeans--the free and open source IDE from Oracle. There are, of course, proponents of both IntelliJ IDEA and Eclipse, and they're both fine choices, but NetBeans offers a complete and robust development out-of-the-box, and it's fast, stable, and free. To download NetBeans, visit http://netbeans.org and download the appropriate installer for your operating system. Since we are using Maven, which IDEA and Eclipse both support, you should be able to open the projects presented here in the IDE of your choice. Where steps are shown in the GUI, though, you will need to adjust for the IDE you've chosen.
At the time of writing, the latest version of NetBeans is 8.2, and the best approach for using it to do Java 9 development is to run the IDE on Java 8, and to add Java 9 as an SDK. There is a development version of NetBeans that runs on Java 9, but, as it is a development version, it can be unstable from time to time. A stable NetBeans 9 should ship at roughly the same time as Java 9 itself. In the meantime, we'll push forward with 8.2:
- To add Java 9 support, we will need to add a new Java platform, and we will do that by clicking on Tools | Platforms.
- This will bring up the Java Platform Manager screen:
- Click on Add Platform... on the lower left side of your screen.
- We want to add a Java Standard Edition platform, so we will accept the default and click on Next.
- On the Add Java Platform screen, we will navigate to where we've installed Java 9, select the JDK directory, and click on Next.
- We need to give the new Java Platform a name (NetBeans defaults to a very reasonable JDK 9) so we will click on Finish and can now see our newly added Java 9 option.
With the project SDK set, we're ready to take these new Java 9 features for a spin, which we'll start doing in Chapter 2, Managing Processes in Java.