java-module

List the modules resolved during the application startup

你离开我真会死。 提交于 2019-12-17 04:07:12
问题 How can one get to know of the list of modules that have been resolved while the application has been started so as to figure out what all service providers are accessible from the root module. 回答1: Module Resolution The module resolution is a two-step process. The first step recursively enumerates the 'requires' directives of a set of root modules. If all the enumerated modules are observable, then the second step computes their readability graph. The readability graph embodies how modules

java application not working with java9 and eclipse

我的梦境 提交于 2019-12-13 13:25:15
问题 I am trying to create a HelloWorld module of Java9 following steps were given below. File>New>Java Project Right-click project(i.e. com.hello)>New>Source Folder>enter source folder name (.e. com.hello ) Right click Source Folder(i.e. com.hello)>New>Package>enter name(same as source folder name i.e com.hello) Right click Source Folder(i.e. com.hello)>New>File>enter file name (java9 standard file name for module which is module-info.java) module com.hello { exports com.hello; } Right Click

Why does Maven shade plugin remove module-info.class?

走远了吗. 提交于 2019-12-13 13:00:38
问题 I try to use maven-shade-plugin for a modular jar: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.1.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <minimizeJar>true</minimizeJar> <artifactSet> <includes> <include>javax.xml.bind:jaxb-api</include> <include>com.sun.xml.bind:jaxb-impl</include> </includes> </artifactSet> <relocations>

How to run a Java 9 main class in Eclipse without editing a launch-configuration?

旧城冷巷雨未停 提交于 2019-12-12 19:30:33
问题 I created a simple Hello World main class and a module-info.java file within a Maven project in Eclipse Oxygen.1a Release (4.7.1a), running on Java 9.0.1. When I try to start the main class with right-click - Run As Java Application I get the error: Error occurred during initialization of boot layer java.lang.module.FindException: Module com.github.gv2011.quarry.modules.moda not found I can successfully run it from the command line from the target/classes directory: java -p . -m com.github

Gradle Migration to Java 11

孤人 提交于 2019-12-12 17:31:22
问题 In the Gradle build file below the fileTree dependency is loading some local jars, but compilation fails with errors like 'package groovy.text is declared in the unnamed module, but module groovy.text does not read it'. I am not sure where the problem reside, could it be that I have to add also something to the compileJava task ? The current configuration is used for a JavaFx application, as discussed in this thread buildscript { repositories { mavenCentral() } dependencies { classpath 'com

Java Jigsaw JUnit Testing - JUnit not in module

这一生的挚爱 提交于 2019-12-11 10:31:39
问题 I'm using Java 9.0.4 in Eclipse Oxygen.3a JUnit 5 is on the modul-path and required in the module-info.java. When I try to run my code i always get the following message: Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\Tim HP.p2\pool\plugins\org.junit.jupiter.migrationsupport_5.0.0.v20170910-2246.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.junit.jupiter.engine

Java module not found at runtime even with requires transitive

北战南征 提交于 2019-12-11 10:07:30
问题 While migrating our project from Java 8 to Java 11 modules, I have a question concerning the Java Module System (JPMS), especially to the required transitive directive. Lets assume we have four simple projects A, B, C and D with the following module declarations in module-info.java : Project A open module a { exports a; } Project B open module b { exports b; requires transitive a; } Project C open module c { exports c; requires transitive b; } Project D open module d { requires transitive c;

Eclipse maven compiler not supporting compiler-plugin compilerArgs

隐身守侯 提交于 2019-12-11 06:38:52
问题 We have a collection of Java module projects (using JDK11). There is a separate project for our integration tests. This project needs to be able to access the main application project to run its tests, but we don't want to add an export to the main application module because it's only needed when we're running our tests. The solution has been to add the export using compilerArgs in our integration test project: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId

Module not found: How to compile JDK 10 Eclipse Maven Project with Module?

江枫思渺然 提交于 2019-12-10 23:45:54
问题 Followings are the main sections of my pom.xml: properties: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.targetEncoding>UTF-8</project.build.targetEncoding> <jdk.release>10</jdk.release> <jdk.vendor>oracle</jdk.vendor> <maven.compiler.source>1.10</maven.compiler.source> <maven.compiler.target>1.10</maven.compiler.target> <dependency.asm.version>6.2</dependency.asm.version> <dependency.log4j2.version>2.11.0</dependency.log4j2.version> <plugin

What else am I missing to load service providers using the new Java module system?

三世轮回 提交于 2019-12-10 10:07:14
问题 I'm adding module-info.java s to Ikonli packages and I'm running into trouble with their service classes. ikonli-core defines an interface called IkonHandler. ikonli-fontawesome5-pack has a service provider for the IkonHandler called FontAwesomeSolidIkonHandler. These service prodivers are used by ikonli-javafx 's IkonResolver. Given this, I created these module definitions: module org.kordamp.ikonli.core { exports org.kordamp.ikonli; } module org.kordamp.ikonli.javafx { exports org.kordamp