jigsaw

Java 11: Implementation of JAXB-API has not been found on module path or classpath

只谈情不闲聊 提交于 2020-01-02 05:52:34
问题 I have a little project which does throw an exception when i let it run. The problem is here (TestObject.java): final JAXBContext jaxbContext = JAXBContext.newInstance(...); I really do not understand why this throws the exception. I also created a test which works like a charm (TestTest.java). Please forgive me the names, but this is just a small test application to get this working with java 11. I followed this: javax.xml.bind.JAXBException Implementation of JAXB-API has not been found on

Groovy Java 9 modules support

情到浓时终转凉″ 提交于 2020-01-02 00:53:05
问题 I've spent some time to migrate my project written in Groovy to Java 10. Now it's possible to compile and run it. But still it doesn't use any benefits of Java 9 modularity. Googling about Groovy and Java 9 modules gives almost nothing. So is it possible to migrate Groovy project to use JDK 10 with Project Jigsaw modules? 回答1: Well, after a few days of experiments I come up with the answer - yes, it is possible to use Groovy with Project Jigsaw modules. But it needs some additional effort.

How can I handle split packages in automatic modules?

允我心安 提交于 2020-01-01 09:01:32
问题 I am currently testing to migrate an existing application to Jigsaw Modules. One of my modules uses ElasticSearch along with its Groovy Plugin. org.elasticsearch:elasticsearch org.elasticsearch.module:lang-groovy Unfortunately, they share a split package, so mvn install gives me: x reads package org.elasticsearch.script.groovy from both lang.groovy and elasticsearch once for each required module in the descriptor, where x is the name of each module. I assume that a newer elasticsearch version

Where to place module-info.java using Java 9?

情到浓时终转凉″ 提交于 2020-01-01 08:38:50
问题 I have an OSGI application and I have around 30 bundles (jar files). Today I decided to see how it works/if it works with Java 9. So I started my application and got WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.felix.framework.util.SecureAction (file:/home/.../jar/org.apache.felix.framework-5.4.0.jar) to method java.net.URLClassLoader.addURL(java.net.URL) WARNING: Please consider reporting this to the maintainers of org.apache

Why Java 9 does not simply turn all JARs on the class path into automatic modules?

强颜欢笑 提交于 2020-01-01 00:48:10
问题 In order to understand the categories we have: platform explicit modules application explicit modules open modules automatic modules unnamed module All classes and jars within the classpath will be part of the unnamed module. But why is that what we need? Where is the advantage over automatic modules? I could "require" those damn legacy jars to make them to an automatic module. Do I not have included everything with it? 回答1: There are at least two reasons: Just as regular modules, automatic

idea: too many module declarations found

不羁的心 提交于 2019-12-30 18:07:06
问题 I want to create hello world java 9 application and start it in intellij idea. Now I have following structure: content of inner module-info.java: module my.module.Second { requires my.module.First; } content of outer module-info.java: module my.module.First { exports my.pack; } But idea complains about my project: Error:(1, 1) java: too many module declarations found I don't understand why it happens and what really wrong. So Question: My question is how to force idea to accept my hello world

Why do we need requires static in java-9 module system? [duplicate]

China☆狼群 提交于 2019-12-30 10:06:32
问题 This question already has answers here : What's the difference between requires and requires static in module declaration (2 answers) Does the Java 9 Module system support optional dependencies? (1 answer) Closed 8 months ago . I started to learn jigsaw java-9 feature and read some articles/video. I can't understand concept of optional dependencies( requires static ) quote from article: When a module needs to be compiled against types from another module but does not want to depend on it at

Loading classes and resources in Java 9

醉酒当歌 提交于 2019-12-28 12:55:33
问题 I was reading this article on InfoQ quoting Reinhold: Developers can still use the Java class path in Java 9 for the Java runtime to search for classes and resource files. It's just that with Java 9's modules, developers no longer need the class path. So now my question is: what is the proper Java 9 way to do the tasks listed above? How do you dynamically load e.g. an image (short of fiddling with relative paths)? Even more interestingly, how would one check if a class is available and make a

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