java-module

How to inject module declaration into JAR?

三世轮回 提交于 2019-11-26 11:17:46
问题 Suppose I have some library lib.jar for which I do not have the source code (or it is written in some non-Java language which is unaware of modules yet). lib.jar does not have module-info.class and I do not want to use it as an automatic module, so I would like to inject module-info.class into it. I first generate module-info.java with the following command: jdeps --generate-module-info . lib.jar Suppose this generated something like that: module lib { exports package1; exports package2; }

What is an automatic module?

北战南征 提交于 2019-11-26 11:12:42
问题 Automatic modules are mentioned many times on stackoverflow but I couldn\'t find a complete, succinct and self-sufficient definition of an automatic module. So, what is an automatic module? Does it export all packages? Does it open all packages? Does it read all other modules? 回答1: I first answer your actual question ("What is an automatic module?"), but I also explain what they are there for . It is hard to understand why automatic modules behave the way they do without that information.

Scanning classpath/modulepath in runtime in Java 9

元气小坏坏 提交于 2019-11-26 06:40:21
问题 I can\'t seem to find any info on whether scanning all available classes (for interfaces, annotations etc) is still possible in runtime, the way Spring, Reflections and many other frameworks and libraries currently do, in the face of Jigsaw related changes to the way classes are loaded. EDIT : This question is about scanning the real physical file paths looking for classes. The other question is about dynamically loading classes and resources. It\'s related but very much not a duplicate .

JDK9: An illegal reflective access operation has occurred. org.python.core.PySystemState

自闭症网瘾萝莉.ら 提交于 2019-11-26 06:38:47
问题 I\'m trying to run DMelt programs (http://jwork.org/dmelt/) program using Java9 (JDK9), and it gives me errors such as: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.python.core.PySystemState (file:/dmelt/jehep/lib/jython/jython.jar) to method java.io.Console.encoding() WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState WARNING: Use --illegal-access=warn to enable warnings of further illegal

Unable to derive module descriptor for auto generated module names in Java 9?

点点圈 提交于 2019-11-26 02:01:23
问题 My project depends on Netty Epoll transport. Here is 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 And as the native keyword is reserved in Java 9 I can\'t add this module as a dependency to my project: module core { requires netty.transport.native.epoll; } Due to:

Replacements for deprecated JPMS modules with Java EE APIs

谁说我不能喝 提交于 2019-11-25 22:49:09
问题 Java 9 deprecated six modules that contain Java EE APIs and they are going to be removed soon: java.activation with javax.activation package java.corba with javax.activity , javax.rmi , javax.rmi.CORBA , and org.omg.* packages java.transaction with javax.transaction package java.xml.bind with all javax.xml.bind.* packages java.xml.ws with javax.jws , javax.jws.soap , javax.xml.soap , and all javax.xml.ws.* packages java.xml.ws.annotation with javax.annotation package Which maintained third