O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modularizing calculator.jar

The last step in the migration is to modularize calculator.jar. Follow the below steps to modularize it:

  1. Copy the folder com from chp3/6_bottom_up_migration_before/calculator/src to the location chp3/6_bottom_up_migration_after/src/calculator.
  2. Create the module definition file module-info.java under chp3/6_bottom_up_migration_after/src/calculator with the following definition:
        module calculator{           requires math.util;           requires banking.util;           requires jackson.databind;           requires jackson.core;           requires jackson.annotations;         }
  1. From within the folder 6_bottom_up_migration_after, compile the Java code of the modules by running the command:
 javac -d mods --module-path ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required