Skip to Content
Java Projects - Second Edition
book

Java Projects - Second Edition

by Peter Verhas
August 2018
Intermediate to advanced
524 pages
14h 45m
English
Packt Publishing
Content preview from Java Projects - Second Edition

What is a Java module?

A Java module is a collection of classes in a JAR or in a directory that also contains a special class named module-info. If there is this file in a JAR or directory, then it is a module, otherwise, it is just a collection of classes that are on the classpath (or not). Java 8, and the earlier versions will just ignore that class as it is never used as code. This way, using older Java, causes no harm, and backwards compatibility is maintained.

To create such a JAR is a bit tricky. The module-info.class file should have bytecode that conforms to Java 9 bytecode or later, but the other classes should contain older version bytecodes.

The module information defines what the module exports and what it requires. It has a ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java 11 Cookbook - Second Edition

Java 11 Cookbook - Second Edition

Nick Samoylov, Mohamed Sanaulla

Publisher Resources

ISBN: 9781789131895Supplemental Content