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

How to do it...

Let's now create a simple application, which is non-modular. Our application will consist of one class named NonModularCalculator, which borrows its code from the class, Calculator, in the recipe Creating a simple modular application.

You can find the NonModularCalculator class definition in the com.packt.calculator package under the directory, chp3/4_modular_jar_with_pre_java9/calculator. As it is non-modular, it doesn't need a module-info.java file. This application makes use of our modular JAR math.util.jar to execute some mathematical calculations. 

At this point, you should have the following:

  • A modular JAR named math.util@1.0.jar
  • A non-modular application consisting of the NonModularCalculator package

Now we need to ...

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