


Java 9 Module Descriptor Errors: How to Handle Auto-Generated Names like \'native\'?
Java 9 Unable to Derive Module Descriptor for Auto Generated Names: Exploring Workarounds
In Java 9, the introduction of modules brought forth a requirement to define module names according to Java identifier rules. However, this requirement poses a challenge for certain auto-generated module names, particularly those that include the keyword "native."
Consider the case of the Netty Epoll transport dependency:
<dependency> <groupid>io.netty</groupid> <artifactid>netty-transport-native-epoll</artifactid> <version>${netty.version}</version> <classifier>${epoll.os}</classifier> </dependency>
The auto-generated module name for this dependency is "netty.transport.native.epoll," which violates Java identifier rules due to the presence of the "native" keyword.
To address this issue, one potential workaround lies in modifying the artifact's META-INF/MANIFEST.MF file to include the Automatic-Module-Name attribute. This attribute defines the module name as it should be used in the module descriptor:
<manifestentries> <automatic-module-name>netty.transport.epoll</automatic-module-name> </manifestentries>
However, this solution requires collaboration with the artifact's owners, making it a less immediate option.
An alternative approach involves having artifact owners include module declarations using module-info.java in their JARs. This action triggers a bottom-up migration process, where dependencies that do not provide module information are assumed to export all packages.
The above is the detailed content of Java 9 Module Descriptor Errors: How to Handle Auto-Generated Names like \'native\'?. For more information, please follow other related articles on the PHP Chinese website!

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools