java-module

How does the Javadoc deal with the visibility of modules in Java 9?

泄露秘密 提交于 2019-11-29 02:31:41
问题 The Javadoc tool generates documentation based on the accessibility modifier. By default, it document all public and protected classes, fields and methods. This can be changed with the following options: -public Shows only public classes and members. -protected Shows only protected and public classes and members. This is the default. -package Shows only package, protected, and public classes and members. -private Shows all classes and members. Java 9 introduces the concept of modules, and

Incompatible types, equality constraints and method not found during Java 9 Migration

断了今生、忘了曾经 提交于 2019-11-29 01:33:56
While migrating one of our projects to Java 9(build 9+181) , I am facing a peculiar problem what looks like an incorrect implementation in some library in use related to type inference and java-module . I am using a dropwizard-core(1.1.0) and guice(4.1.0) configurations as follows: public class CustomService extends io.dropwizard.Application<CustomServiceConfig> { public static void main(String[] args) throws Exception { new CustomService().run(args); } // other initializations @Override public void run(CustomServiceConfig config, io.dropwizard.setup.Environment environment) throws Exception {

Is there a replacement library for CORBA in JDK 11

早过忘川 提交于 2019-11-28 20:14:45
JDK-11 will remove a lot of older parts of the JDK ( JEP-320 ). For some of them (e.g. JAXB) functionality will be provided as regular library. You simply add another dependency and everything works fine again. But not so for CORBA, because There is no significant interest in developing modern applications with CORBA in Java I am however in the painful situation of needing to maintain older applications that still require CORBA while still wanting to update to JDK-11. Is there a replacement-library out there or another good way of migrating to JDK-11 without removing the CORBA functionality of

Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1

旧城冷巷雨未停 提交于 2019-11-28 17:12:32
My JDK 9+181 Spring Boot 2.0.0.BUILD-SNAPSHOT CLI application displays this warning on startup: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/home/jan/src/fm-cli/target/fm-cli-0.1.0-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-5.0.0.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1 This is a console application,

What's the difference between requires and requires static in module declaration

为君一笑 提交于 2019-11-28 09:46:41
What's the difference between requires and requires static module statements in module declaration? For example: module bar { requires java.compiler; requires static java.base; } A requires clause expresses that the required module is needed at compile and run time. Consequently, when the module system encounters such a clause during module resolution (the phase in which module descriptors are processed and dependencies are resolved) it searches the universe of observable modules (the modules in the JDK and on the module path) and throws an error if it doesn't find the module. A requires

creating module-info for automatic modules with jdeps in java 9

Deadly 提交于 2019-11-28 07:52:33
I have 3 jar of jackson library jackson-core-2.8.10.jar jackson-annotations-2.8.0.jar jackson-databind-2.8.10.jar I created module-info.java for both core and annotation successfully and converted them to Named maodule using jdeps. for databind , I tried following command: jdeps --generate-module-info . --module-path %JAVA_HOME%\jomds;jackson.core;jackson.annotations existingmods\jackson-databind-2.8.10.jar Now following error is occuring : Missing dependence: .\jackson.databind\module-info.java not generated Error: missing dependencies com.fasterxml.jackson.databind.AnnotationIntrospector ->

Classloaders hierarchy in Java 9

こ雲淡風輕ζ 提交于 2019-11-28 05:06:55
As of Java-8, I know the hierarchy of the classloaders has been as follows:- Bootstrap classloader -> Extension classloader -> Application classloader What is the change in the hierarchy of classloaders in Java 9 and how does it works? The ClassLoader as revised in Java-9 states that: The Java run-time has the following built-in class loaders: Bootstrap class loader : The virtual machine's built-in class loader typically represented as null, and does not have a parent. Platform class loader : To allow for upgrading/overriding of modules defined to the platform class loader, and where upgraded

What's the difference between requires and requires transitive statements in Java 9?

拜拜、爱过 提交于 2019-11-28 04:38:24
What's the difference between requires and requires transitive module statements in module declaration? For example: module foo { requires java.base; requires transitive java.compiler; } Readability recap If module bar requires module drink , then the module system... enforces the presence of drink (called reliable configuration ) allows bar to read drink (called readability ) allows code in bar to access public classes in exported packages in drink (called accessibility ) Exactly the same happens if bar requires transitive drink - drink must be present, can be read and accessed. In fact, for

What are the predefined modules in JDK9 or Which module do I need to fix dependency problems?

泄露秘密 提交于 2019-11-28 01:39:01
问题 JDK9 will (probably) introduce a module system. As part of that, the Java Class Library will get modularized. This can lead to exceptions when classes don't get found because they are in a module that isn't specified as a dependency yet. What are the modules that will get created with the module system and what is their respective content? Or stated differently: Given a class that doesn't get loaded, how do I find the proper module to include as a dependency? 回答1: how do I find the proper

Java 9 HttpClient java.lang.NoClassDefFoundError: jdk/incubator/http/HttpClient

冷暖自知 提交于 2019-11-28 00:21:27
问题 I am trying to use the HttpClient from incubator in Java 9 maven project. I am not getting any Compilation issue. The project builds successfully. But when I try to run the Main class, it gives me the following exception: Exception in thread "main" java.lang.NoClassDefFoundError: jdk/incubator/http/HttpClient at java9.http_client.Main.main(Main.java:18) Caused by: java.lang.ClassNotFoundException: jdk.incubator.http.HttpClient at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass