java-9

Patching module raises module not found error

女生的网名这么多〃 提交于 2019-12-23 09:33:13
问题 I use jdk 11 and try to understand --patch-module option for java compiler. Here is the simple module I have: mdl-platform | | |___com.test.mdl.platform | | | |___ ... | | | |___Patch.java | |___module-info.java module-info.java : module com.test.mdl.plarform { exports com.test.mdl.platform; } Patch.java : public class Patch { } I have Patch.java file and wanted to patch the module with it. I tried: I. $ javac --patch-module com.test.mdl.platform=mdl-plarform/src/main/java/ \ mdl-plarform/src

Is there a maven jigsaw jlink plugin?

心已入冬 提交于 2019-12-23 07:27:58
问题 Does maven have a plugin for the new Java 9 jlink I have searched online but have not been able to find anything official from the maven team. 回答1: Yes . There has been some progress made to create one on Github/maven-plugins for the same. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jlink-plugin</artifactId> <version>3.0.0-SNAPSHOT</version> </plugin> The plugin in its code reads to be adaptive to JEP-282 and JEP-220 from the proposals. And though this might look

How to exclude module-info.java in Netbeans (11)?

 ̄綄美尐妖づ 提交于 2019-12-23 03:06:53
问题 Our source code is still Java 8 complient, but we have two different builds: one built with JDK 11 and module-info.java . And one with JDK 8 and without module-info.java . With maven, this is easy two accomplish with to different profiles. For the JDK 8 profile, module-info.java is excluded: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> ... <excludes> <exclude>module-info.java</exclude> </excludes> </configuration> </plugin> When this project

Confused about java 9 ServiceLoader::load method and the way how to provide a service impl

≯℡__Kan透↙ 提交于 2019-12-23 02:43:07
问题 In this java document: https://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html Deploying service providers as modules chapter,it says: com.example.impl.ExtendedCodecsFactory is a public class that does not implement CodecFactory, but it declares a public static no-args method named "provider" with a return type of CodecFactory. But the fact is I can't use provides...with to provide a service implementation and it will throw a compile error and runtime error without implement

Confused about java 9 ServiceLoader::load method and the way how to provide a service impl

泪湿孤枕 提交于 2019-12-23 02:42:56
问题 In this java document: https://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html Deploying service providers as modules chapter,it says: com.example.impl.ExtendedCodecsFactory is a public class that does not implement CodecFactory, but it declares a public static no-args method named "provider" with a return type of CodecFactory. But the fact is I can't use provides...with to provide a service implementation and it will throw a compile error and runtime error without implement

Can one Java module export a package whose name is a subpackage of a package from another module? [duplicate]

别来无恙 提交于 2019-12-22 18:49:13
问题 This question already has an answer here : Java 9 sub-packages split across modules (1 answer) Closed 11 months ago . So I know that, in Java 9 modules (Project Jigsaw), split packages are not allowed. That is, the following modules couldn't both export a package with the same name and also be used at the same time at run time: Module 1 module com.example.foo { exports com.example.foo; } Module 2 module com.example.foo { exports com.example.foo; } Not allowed (or, at least, they can't run at

Gradle does not honor --add-modules jvm argument in JDK9

送分小仙女□ 提交于 2019-12-22 09:29:58
问题 I am trying JDK9 (9-ea+143), and need to set --add-modules java.xml.bind . I have tried: Setting GRADLE_OPTS="--add-modules java.xml.bind '-Dorg.gradle.jvmargs=--add-modules java.xml.bind'" Setting org.gradle.jvmargs=--add-modules java.xml.bind in gradle.properties. Adding test { jvmArgs '--add-modules java.xml.bind' } to build.gradle Adding tasks.withType(Test) { jvmArgs '--add-modules java.xml.bind' } to build.gradle Adding tasks.withType(JavaExec) { jvmArgs '--add-modules java.xml.bind' }

SubmissionPublisher on submit not invoking onNext of subscriber

馋奶兔 提交于 2019-12-22 08:34:10
问题 Every interval I retrieve tweets with a certain query. These tweets have to be passed to services which calculate and manipulate those tweets. So these services are subscribed to my publisher. So publisher.hasSubscribers() returns true. But the submit or offer function does not invoke the onNext of my subscriber. So as a "fix", I cycle through my subscribers and invoke it myself. But that shouldn't be the case. This is the constructor of my publisher. public TwitterStreamer(Executor executor,

java 9 unnamed module reads package [X] from both … while debugging (with IntelliJ)

主宰稳场 提交于 2019-12-22 08:10:13
问题 In my project I have a package that uses several 3rd party libraries. Let's have a look at the dependency tree: [INFO] +- commons-logging:commons-logging:jar:1.2:compile [INFO] +- org.apache.directory.studio:org.apache.commons.collections:jar:3.2.1:compile [INFO] | \- commons-collections:commons-collections:jar:3.2.2:compile [INFO] +- xerces:xercesImpl:jar:2.11.0:compile [INFO] | \- xml-apis:xml-apis:jar:1.4.01:compile [INFO] +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.2.2:compile [INFO] | +

Java 9 migration issue - package com.mymodule is declared in unnamed module , module 'newmodule' does not read it

荒凉一梦 提交于 2019-12-22 07:59:13
问题 I have created a multimodule project with the following structure myproject |- mymodule |- src |- main |- java |- com |- mymodule |- Util.java |-newmodule |-src |-main |-java |-com |-newmodule |- Main.java |-module-info.java Now i want to use Util.java which is a non modularized code in a modularized module newmodule. i have declared following in newmodule module newmodule { requires mymodule; } Project is compiling fine, but Intellij is showing module not found and package com.mymodule is