To create a module in Java, you must define a module-info.java file in your module's root directory. This file specifies the module's name, dependencies, and exports, among other things. Once you have defined the module, you can use the module keyword to declare dependencies on other modules and specify which packages and classes are exported by your module.