jigsaw

Migrating maven project to modules - ignore module-info.java

十年热恋 提交于 2019-12-11 17:23:16
问题 We're currently migrating to JPMS setting up module-info.java for all modules in a maven multi-module project. For us it would be ideal to have module-info.java already reside in "dev" branch but not affecting any builds. So idea is to exclude module-info.java by default and include it only in specific maven profiles. Does that make sense? Anyway, doesn't work for me, module-info.java is picked up even though in excludes section as follows: <plugin> <groupId>org.apache.maven.plugins</groupId>

Java Jigsaw JUnit Testing - JUnit not in module

这一生的挚爱 提交于 2019-12-11 10:31:39
问题 I'm using Java 9.0.4 in Eclipse Oxygen.3a JUnit 5 is on the modul-path and required in the module-info.java. When I try to run my code i always get the following message: Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\Tim HP.p2\pool\plugins\org.junit.jupiter.migrationsupport_5.0.0.v20170910-2246.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.junit.jupiter.engine

JavaBeanProperties in JavaFX without pulling in java.desktop (Swing, AWT)

梦想的初衷 提交于 2019-12-11 07:51:37
问题 I have some model classes that are instantiated many times and have many fields. While I could initialize all fields as Simple*Property s, this significantly slows performance due to the allocations (and lazy-creating the properties is not an option). Thus, I would prefer to use JavaBeanProperties to create on-demand bindings where needed in the application like so (see this answer for a full example JavaBean wrapping with JavaFX Properties): Entity bean = ... StringProperty nameProperty =

Jigsaw: Bundling JRE with Automatic Modules

老子叫甜甜 提交于 2019-12-11 04:13:17
问题 Is there a way to bundle the JRE with jlink if not all or even none of the application's dependencies are yet modularized? I do understand that this does not lead to trimmed runtimes but still, I want to bundle a JRE with my application, even untrimmed. 来源: https://stackoverflow.com/questions/53314512/jigsaw-bundling-jre-with-automatic-modules

Import of a Java-9-Jigsaw-Maven-Project in Eclipse Oxygen 4.7 does not work

本小妞迷上赌 提交于 2019-12-11 02:25:19
问题 Import of a Java-9-Jigsaw-Maven-Project in Eclipse Oxygen 4.7 does not work I use: JDK 9 build 9-ea+172 Maven 3.5.0 Eclipse Oxygen 4.7 RC3 Version 4.7.0.I20170531-2000 from 2017-05-31 Eclipse-Plugins: Eclipse JDT (Java Development Tools) Patch with Java 9 support (BETA) for Oxygen development stream, 1.1.1.v20170526-0728_BETA_JAVA9 m2e - Maven Integration for Eclipse (includes Incubating components), 1.8.0.20170516-2043 Creata a new Jigsaw-Maven-Project: mkdir proj1\a\src\main\java\a\a cd

Intellij: how to add java.annotation module for javax.annotation.PostConstruct

蓝咒 提交于 2019-12-11 01:23:56
问题 I upgraded the SDK that my project uses to Java 10. The following import statement caused an error: import javax.annotation.PostConstruct; Package 'javax.annotation' is declared in module 'java.xml.ws.annotation', but module 'application' does not read it Hitting ALT+ENTER to let Intellij fix it, I received the following options: I selected Add Maven Dependency... and the following dependency was added to pom.xml. <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation

Spring Boot 2.1 with Java 11: Unable to resolve persistence unit root URL

南笙酒味 提交于 2019-12-10 16:00:47
问题 I have an application, that uses Spring Boot and Spring Data JPA with annotation-only based configuration for its persistence layer. I've started migrating this application to the latest Spring Boot version (2.1.x) along with Java (OpenJDK) 11. After configuring the module descriptors, the application starts up, but when Spring reaches the point where it wants to build up the persistence layer, the application stops with the following exception: Caused by: javax.persistence

IntelliJ doesn't Understand java libraries on Java9-ea

混江龙づ霸主 提交于 2019-12-10 03:01:16
问题 I am using jdk9-ea 149 and created a sample javafx application IntelliJ doesn't understand the java libraries, It's shows all the import statement in red color and they are all grayed out .even for java.util.List, java.util.ArrayList it has the same issue. I am able to compile form outside but i am not able to compile the code from IntelliJ 2016.3.2 Ultimate Edition . It looks like we need to add some libraries to IntelliJ project but with java9 build 149 jigsaw i don't know how to do that. I

Why is exporting the entire module not allowed?

你说的曾经没有我的故事 提交于 2019-12-09 02:27:06
问题 In Java 9's module declaration there are 2 constructs: exports com.foo; And opens com.foo; Where exports grants compile-time access, while opens allows runtime access, as reflection and resources. opens has one leniency over exports that you can define the whole module as open, resulting the same as explicitly opening every package: open module com.mod { But there's no similar construct exported module com.mod { My Question : Why is it so; what decisions has been made to allow opening the

module java.base does not read module java.desktop

落爺英雄遲暮 提交于 2019-12-07 03:29:03
问题 When I run this test (using jmockit and TestNG, not sure if that's relevant): public class Test { @Test public void test(@Mocked ProcessBuilder pb) throws IOException { new Expectations() {{ pb.start(); result = null; }}; assertNull(m()); } public static Process m() throws IOException { return new ProcessBuilder("").start(); } } I get this exception: java.lang.IllegalAccessError: class java.lang.ProcessBuilder (in module java.base) cannot access class javax.print.PrintException (in module