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

Creating Your First Java Module

In the previous chapter, we took a detailed look at the problems associated with modularizing Java code pre-Java 9, as well as the new module construct in Java 9 and Project Jigsaw. Before we examine how Java modularity solves these problems, you'll need to first understand what a Java module looks like. In this chapter, you'll create your first Java 9 module and learn what it takes to build and execute code in a Java module. Here are the top-level topics you'll be learning in this chapter:

  • Setting up the JDK with Java 9
  • Creating a new Java 9 module
  • Defining a module (using module-info.java)
  • Compiling and executing a module
  • Handling possible errors

You'll be building a sample Java 9 application throughout this book as you learn the different concepts related to modularity. The application you'll build is an address book viewer application that displays some contacts sorted by last name. We'll start simple and enhance this application as we go. When you are done with this chapter, you'll have built your first Java 9 module and learned how to compile and execute it. Let's start by first installing the JDK.

主站蜘蛛池模板: 吐鲁番市| 台北市| 渝北区| 怀来县| 大荔县| 大荔县| 潞城市| 电白县| 汤阴县| 宕昌县| 东丽区| 酒泉市| 拜城县| 讷河市| 永城市| 纳雍县| 苍梧县| 湘潭市| 宜阳县| 利辛县| 阿鲁科尔沁旗| 新乡县| 镇康县| 晋江市| 平阴县| 北宁市| 名山县| 襄汾县| 永德县| 迁安市| 洪雅县| 武鸣县| 周口市| 平遥县| 宜黄县| 昂仁县| 柳林县| 沙坪坝区| 巴里| 罗江县| 阿坝县|