官术网_书友最值得收藏!

Getting started

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:

  1. To add Java 9 support, we will need to add a new Java platform, and we will do that by clicking on Tools | Platforms.
  2. This will bring up the Java Platform Manager screen:
  1. Click on Add Platform... on the lower left side of your screen.
  1. We want to add a Java Standard Edition platform, so we will accept the default and click on Next.
  1. On the Add Java Platform screen, we will navigate to where we've installed Java 9, select the JDK directory, and click on Next.
  1. 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.

If you do run NetBeans on Java 9, which should be possible by the time this book is published, you will already have Java 9 configured. You can, however, use the preceding steps to configure Java 8, should you need that version specifically.
主站蜘蛛池模板: 藁城市| 峨眉山市| 肇东市| 塔河县| 依兰县| 涿鹿县| 兴化市| 阿拉善左旗| 富阳市| 宣城市| 洪泽县| 南木林县| 嘉黎县| 阳江市| 苍梧县| 余江县| 襄垣县| 普安县| 海城市| 龙川县| 工布江达县| 舞钢市| 崇文区| 应用必备| 宜都市| 商城县| 仲巴县| 巴林左旗| 炎陵县| 揭西县| 四平市| 无为县| 文成县| 郸城县| 旬阳县| 田东县| 周口市| 永丰县| 通道| 宽甸| 九龙坡区|