java-platform-module-system

Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base'

拥有回忆 提交于 2021-02-18 06:06:45
问题 In module-info.java i get the error Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base'. Not only does the migration (Java 8 to Java 11) frustrate me slowly but surely, this error does not make any sense to me. The dependencies part fo my build.gradle : def springFrameworkVersion = '5.1.2.RELEASE' def hibernateVersion = '5.3.7.Final' def junitJupiterVersion = '5.3.1' dependencies { compile 'org.transentials:cardhouse-commons:1.1.1' compile 'ch.qos

Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base'

馋奶兔 提交于 2021-02-18 06:05:01
问题 In module-info.java i get the error Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base'. Not only does the migration (Java 8 to Java 11) frustrate me slowly but surely, this error does not make any sense to me. The dependencies part fo my build.gradle : def springFrameworkVersion = '5.1.2.RELEASE' def hibernateVersion = '5.3.7.Final' def junitJupiterVersion = '5.3.1' dependencies { compile 'org.transentials:cardhouse-commons:1.1.1' compile 'ch.qos

Make “gradle javadoc” task work with Java 9

前提是你 提交于 2021-02-07 20:59:55
问题 I have a multi-module Gradle Java project using source/target = 1.9/1.9. There are two modules, my.base and my.dependsOnBase . The my.base module has no other dependencies: module my.base { exports my.base.foo; exports my.base.bar; } The my.dependsOnBase module has only a single dependency, which is my.base : module my.dependsOnBase { requires my.base; exports my.dependsOnBase.baz; } When I run $ gradle javadoc it works fine on my.base . But when it gets to my.dependsOnBase I get the

Make “gradle javadoc” task work with Java 9

血红的双手。 提交于 2021-02-07 20:58:35
问题 I have a multi-module Gradle Java project using source/target = 1.9/1.9. There are two modules, my.base and my.dependsOnBase . The my.base module has no other dependencies: module my.base { exports my.base.foo; exports my.base.bar; } The my.dependsOnBase module has only a single dependency, which is my.base : module my.dependsOnBase { requires my.base; exports my.dependsOnBase.baz; } When I run $ gradle javadoc it works fine on my.base . But when it gets to my.dependsOnBase I get the

List modules in jar file

烈酒焚心 提交于 2021-02-06 09:58:14
问题 I've created what I'm pretty sure is a modular jar file. But if possible, I'd like to double check. Given a jar file, is there a way to determine what modules the compiler would find within it? 回答1: The alternative is to use the jar --describe-module ( -d for short), e.g.: jar --file=myjar.jar --describe-module 回答2: You can list the modules within the jar using the following java tool command:- java -p yourModular.jar --list-modules Edit : You shall preferably make use of the jar command lin

Java 9: Exporting packages to unnamed modules fail

亡梦爱人 提交于 2021-02-04 14:42:47
问题 I am trying to build an open-source project against Java 9. There are some files which I need to access using reflection but I cannot because the packages are not exported by their modules. I export the packages to unnamed modules by using the arguments --add-exports . I have added the following arguments to environment variable _JAVA_OPTIONS : -Dsun.reflect.debugModuleAccessChecks=true --add-exports=javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED --add-exports=javafx.controls/com

Java 9: Exporting packages to unnamed modules fail

♀尐吖头ヾ 提交于 2021-02-04 14:41:40
问题 I am trying to build an open-source project against Java 9. There are some files which I need to access using reflection but I cannot because the packages are not exported by their modules. I export the packages to unnamed modules by using the arguments --add-exports . I have added the following arguments to environment variable _JAVA_OPTIONS : -Dsun.reflect.debugModuleAccessChecks=true --add-exports=javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED --add-exports=javafx.controls/com

java.lang.module.ResolutionException when adding google-cloud-datastore dependency to modular Java 11 project

家住魔仙堡 提交于 2021-01-29 09:13:11
问题 I have a modular jersey based microservice running on JDK 11. It deploys fine to Google App Engine. The code can be downloaded here (or clone the main project and switch to the 3.1 tag): https://github.com/Leejjon/SimpleJerseyService/releases/tag/3.1 Now I want to add access to the Google Cloud Datastore API (which worked on my previous non modular Java 8 project). So I add the maven dependency: <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-datastore</artifactId>

Package accessible from more than one module: <unnamed>

混江龙づ霸主 提交于 2021-01-22 05:28:14
问题 When trying to register an MBean in JMX Console I'm getting the following error message: The package javax.management is accessible from more than one module: <unnamed>, java.management I'm using Eclipse and I have no module-info.java file in my project structure. The error disappear when I comment my dependency for Java EE API, but the javax.management package is not part of the JAR. 回答1: I experienced similar issue when updating from java 8 to java 11. Steps below helped me, Right click

Package accessible from more than one module: <unnamed>

大兔子大兔子 提交于 2021-01-22 05:27:38
问题 When trying to register an MBean in JMX Console I'm getting the following error message: The package javax.management is accessible from more than one module: <unnamed>, java.management I'm using Eclipse and I have no module-info.java file in my project structure. The error disappear when I comment my dependency for Java EE API, but the javax.management package is not part of the JAR. 回答1: I experienced similar issue when updating from java 8 to java 11. Steps below helped me, Right click