jigsaw

ResolutionException with Hibernate and JavaFx

戏子无情 提交于 2019-12-23 05:04:08
问题 Im having some issue and I had no luck figuring it out how to fix it. I have a JavaFx Project which has Hibernate and Proguard. But whenever I try to run the task 'runProguard' fails with java.lang.module.ResolutionException. What's puzzling me is the fact that my project doesnt use modules. Is there anyway to fix this? Task :runProguard FAILED Task ':runProguard' is not up-to-date because: Task has not declared any outputs despite executing actions. Starting process 'command ... Successfully

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

Java Beans Introspector requires desktop module

巧了我就是萌 提交于 2019-12-22 05:33:10
问题 I'm investigating using Jigsaw to reduce the footprint of a microservice. One of the last dependencies I had to find was java.beans.Introspector. Imagine my surprise when I discovered I needed to bring in the whole module java.desktop which contains all sorts of irrelevant stuff like awt, applets, swing etc. This seems crazy to me, surely bean introspection should be a part of the fundamental language and not related to UI functionality. I think the dependency comes from the embedded Tomcat

RuntimeException: Package jdk.internal.jimage.decompressor in module jrt.fs and module java.base

此生再无相见时 提交于 2019-12-22 05:29:17
问题 Component Details - Using IntelliJ IDEA 2017.1 CE and jdk-9-ea+154 main() - Set<String> set2 = Set.of("a", "b", "c"); set2.forEach(System.out::println); module-info.java module collection { requires java.base; } Logs - Error occurred during initialization of VM java.lang.RuntimeException: Package jdk.internal.jimage.decompressor in both module jrt.fs and module java.base at jdk.internal.module.ModuleBootstrap.fail(java.base@9-ea/ModuleBootstrap.java:699) at jdk.internal.module.ModuleBootstrap

How to use sun.reflect package in jdk9/java-9?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 04:56:20
问题 I am using jdk-9 and I want to use sun.reflect.* package in my code but I am getting the below exception Exception in thread 'main' java.lang.IllegalAccessError : class Test (in moudle: Unnamed Module) cannot access class sun.reflect.Reflaction (in module:java.base), sun.reflect is not exported to Unnamed module when I run below sample code using JDK-9 public static void main(String args[]){ System.out.println(Reflection.getCallerClass(3)); } 回答1: These sun.* packages were never part of the

Why does compilation of public APIs leaking internal types not fail?

点点圈 提交于 2019-12-22 03:35:18
问题 I have the follwing Java 9 module: module com.example.a { exports com.example.a; } With an exported type: public class Api { public static void foo(ImplDetail args) {} } And a non-exported type: package com.example.b.internal; public class ImplDetail {} The exported type uses the non-exported type as a method parameter type in a public method. I'd have assumed that the compiler would reject such an inconsistent class configuration, as clients in other modules could not really invoke the foo()

How to run Java 9 application with classpath rather than module path in IDEA?

我的梦境 提交于 2019-12-21 23:09:29
问题 When I run a main class in IDEA, it puts the module and its dependencies on a module path. Is it possible to change it to a classpath? 回答1: If you don't define a module-info, IDEA would set the application and your dependencies on the classpath. Since you have a module-info it's an explicit module so it has to be on the module path. Normally you would handle your dependecies now as automatic-modules. Howsoever, your dependencies at least have a good reason to be on the classpath. We discussed

Is it possible to use dependencies without module-info.class in a Java 9 module

余生长醉 提交于 2019-12-21 07:40:11
问题 I created two small projects de.app1 and de.app2 , where App from de.app1 uses Test from de.app2 . ├── de.app1 │ ├── de │ │ └── app │ │ └── App.java │ └── module-info.java └── de.app2 └── de └── test └── Test.java module-info.java in the first project just contains module de.app1 {} I compiled the second project and created a jar file: javac de/test/Test.java jar cf app2.jar de/test/Test.class and then tried to compile the first project like this: javac -cp ../de.app2/app2.jar de/app/App.java

What do I need to build JDK 9 project with non-modular dependencies using Maven

五迷三道 提交于 2019-12-21 07:38:05
问题 I have a simple Java 9 SE project with one dependency on a non-modularized project (chose Weld SE for this example) and I am trying to build it with Maven ( clean install ).In order for Java 9 to kick in, I have added module-info.java . Originally, this file only contained module name and had no requires formulas. Please bear in mind that my sole dependency is NOT a modular project, therefore I presumed Maven will put in the classpath (not module-path) and hence it will end up in the unnamed

How to add “requires” for artifact having “-”(hyphen) in its name

寵の児 提交于 2019-12-21 07:08:20
问题 I've included these dependencies in my Maven pom.xml: <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>${httpclient.version}</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> I am trying to add this dependency in module-info.java like so: module io.github.wildcraft.restclient { requires httpcore; // no compilation problem requires httpclient; // no