jigsaw

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

ⅰ亾dé卋堺 提交于 2019-11-30 04:53:47
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 project Jigsaw applies it to the existing JDK. A talk by Mark Reinhold (3rd in a series of talks about

Do Kotlin 1.2.10 and Java 9 have opposite rules regarding automatic modules?

百般思念 提交于 2019-11-30 04:03:42
问题 I have a Gradle project using the Kotlin Gradle plugin. I want to build a Java 9 module, so my directory structure looks like this: src/main/java/ - module-info.java src/main/kotlin/ - Foo.kt - Bar.kt build.gradle ... My build.gradle declares the following dependencies: dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.10" compile "org.jetbrains.kotlin:kotlin-reflect:1.2.10" compile "org.junit.jupiter:junit-jupiter-api:5.0.2" } and I use all of these dependencies in my

Are cycles allowed between platform modules?

巧了我就是萌 提交于 2019-11-30 02:37:47
问题 This is the module declaration of the java.rmi module: module java.rmi { requires java.base; requires java.logging; exports java.rmi.activation; exports com.sun.rmi.rmid to java.base; // <-- cycle ... } So, there is a cyclic dependency between java.rmi and java.base , right? Are cycles allowed between platform modules? 回答1: The module system forbids statically declaring cycles with requires clauses. This is true for platform and application modules and the example you give does not violate

Project Jigsaw vs Maven

删除回忆录丶 提交于 2019-11-29 21:19:41
From Jigsaw Project : Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms. I'm trying to learn what project Jigsaw is and till now it seems that the goal of Project Jigsaw somewhat overlaps with what we did using Maven (or Gradle) dependency management: Is it a threat to build tools like Maven? Or my understanding is wrong and project Jigsaw is going to complement these build tools in some way? michaldo Very simplified answer After Jigsaw , public will be public only within the JAR scope. To see the class outside the

Using different versions of dependencies in separated Java platform modules

陌路散爱 提交于 2019-11-29 18:31:11
问题 I expected it's possible to use i.e. Guava-19 in myModuleA and guava-20 in myModuleB, since jigsaw modules have their own classpath. Let's say myModuleA uses Iterators.emptyIterator(); - which is removed in guava-20 and myModuleB uses the new static method FluentIterable.of(); - which wasn't available in guava-19. Unfortunately, my test is negative. At compile-time, it looks fine. In contrast to runtime the result is a NoSuchMethodError. Means that, the class which was the first on the

Can I require Java 9 module via MANIFEST.MF?

岁酱吖の 提交于 2019-11-29 17:59:40
问题 My Java library should be compatible with Java 8 and Java 9. For running with Java 9 we need some of the Java 9 modules. I know that I can add it via command line with --add-modules . But it is a library and I can't control the command line. Is there an equivalent of --add-modules in MANIFEST.MF ? Or is there any other solution that is compatible with Java 8? 回答1: Unfortunately, there is no equivalent of --add-modules in MANIFEST.MF . However, you can create module-info.java and declare your

findResource(“”) returning null when module-info.java is present, why is that?

廉价感情. 提交于 2019-11-29 16:35:11
问题 I'm debugging why in the presence of module-info.java in my Spring Boot application, spring-orm throws an exception during start up time. This is the exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction

Missing dependencies when generate-module-info jdeps

♀尐吖头ヾ 提交于 2019-11-29 10:02:16
I`m trying to run jdeps with the following command: jdeps --module-path modules --generate-module-info out com.demo.market.jar My com.demo.market.jar depends both on application modules and automatic modules. I put all dependencies in the 'modules' folder but I got an error: Error: missing dependencies com.demo.market.platform.MarketPlace -> com.demo.client.wholesale.Client not found com.demo.market.platform.MarketPlace -> com.demo.product.api.Product not found com.demo.market.platform.MarketPlace -> com.demo.product.laptop.Laptop not found com.demo.market.collector.ProductsCollector -> com

Add a custom JMOD to the module path with Java 9

我的梦境 提交于 2019-11-29 09:33:32
问题 I created a simple JMOD file with the jmod tool like this $JAVA_HOME/bin/jmod create --class-path classes test/samples.jmod Next, I tried to execute a class within that module by running: java -mp test -m de.mypackage/de.mypackage.Test Which resulted in the following exception: Error occurred during initialization of VM java.lang.module.ResolutionException: JMOD files not supported: test/samples.jmod at java.lang.module.Resolver.findWithBeforeFinder(java.base@9-ea/Resolver.java:729) at java

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

£可爱£侵袭症+ 提交于 2019-11-29 08:18:08
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? how do I find the proper module to include as a dependency? Consider this spoof class: import java.sql.DriverManager; import java.rmi