java-module

How to access to resources in external resource folder in Java 9 modular project [duplicate]

ぐ巨炮叔叔 提交于 2020-08-06 05:01:06
问题 This question already has answers here : Accessing resource files from external modules (2 answers) How to work with resources in Java 9 modules (1 answer) Java 9 Module system Resources files location (2 answers) Closed 2 years ago . When I have the following code that attempts accessing to a resource: foo/Main.java package foo; import java.io.*; public class Main{ public static void main(String... args) throws IOException{ try(BufferedReader in = new BufferedReader(new InputStreamReader(

How to access to resources in external resource folder in Java 9 modular project [duplicate]

爷,独闯天下 提交于 2020-08-06 05:01:06
问题 This question already has answers here : Accessing resource files from external modules (2 answers) How to work with resources in Java 9 modules (1 answer) Java 9 Module system Resources files location (2 answers) Closed 2 years ago . When I have the following code that attempts accessing to a resource: foo/Main.java package foo; import java.io.*; public class Main{ public static void main(String... args) throws IOException{ try(BufferedReader in = new BufferedReader(new InputStreamReader(

How to access to resources in external resource folder in Java 9 modular project [duplicate]

江枫思渺然 提交于 2020-08-06 05:01:01
问题 This question already has answers here : Accessing resource files from external modules (2 answers) How to work with resources in Java 9 modules (1 answer) Java 9 Module system Resources files location (2 answers) Closed 2 years ago . When I have the following code that attempts accessing to a resource: foo/Main.java package foo; import java.io.*; public class Main{ public static void main(String... args) throws IOException{ try(BufferedReader in = new BufferedReader(new InputStreamReader(

How to resolve a maven dependency with a name that is not compliant with the java 9 module system? [duplicate]

南楼画角 提交于 2020-07-18 06:43:06
问题 This question already has an answer here : Unable to derive module descriptor for auto generated module names in Java 9? (1 answer) Closed 2 years ago . I am trying to build a demo project in java 9 with maven that uses the dependency: <dependency> <groupId>org.apache.spark</groupId> <artifactId>spark-mllib_2.10</artifactId> <version>2.2.0</version> </dependency> However when I run the jar tool to determine the automatic module name to use in my project's module-info.java I get the following

How to resolve a maven dependency with a name that is not compliant with the java 9 module system? [duplicate]

天涯浪子 提交于 2020-07-18 06:43:05
问题 This question already has an answer here : Unable to derive module descriptor for auto generated module names in Java 9? (1 answer) Closed 2 years ago . I am trying to build a demo project in java 9 with maven that uses the dependency: <dependency> <groupId>org.apache.spark</groupId> <artifactId>spark-mllib_2.10</artifactId> <version>2.2.0</version> </dependency> However when I run the jar tool to determine the automatic module name to use in my project's module-info.java I get the following

Cannot be cast to class because they are in unnamed module of loader 'app'

允我心安 提交于 2020-07-05 05:17:49
问题 I'm trying to create a bean from sources that were generated by wsdl2java. Every time I try to run my Spring Boot app, I get the following error: Caused by: java.lang.ClassCastException: class org.apache.cxf.endpoint.ClientImpl cannot be cast to class com.xignite.services.XigniteCurrenciesSoap (org.apache.cxf.endpoint.ClientImpl and com.xignite.services.XigniteCurrenciesSoap are in unnamed module of loader 'app') I'm not sure how exactly I'm to include generated sources in my main Spring Boot

Java: Is `sun.awt.image` package deprecated?

这一生的挚爱 提交于 2020-06-25 21:12:17
问题 I was wanting to use some codes that using sun.awt.image.PNGImageDecoder in my project. The problem is source code is based on Java 8 and my project using JDK 9+ (11). So I got this error: Package ' sun.awt.image ' is declared in module ' java.desktop ', which does not export it to the unnamed module . for import sun.awt.image.* , and: Symbol is declared in module ' java.desktop ' which does not export package ' sun.awt.image ' for using PNGImageDecoder or ImageDecoder etc. After some efforts

The package is accessible from more than one module problem under VSCode only

廉价感情. 提交于 2020-06-01 13:05:13
问题 I have a project which builds fine under gradle as well as in the IntelliJ IDE run configuration. But it gives a problem in the VSCode IDE: The package javax.crypto is accessible from more than one module The are no module-info.java file in the entire project. The modules listed are: ~/Desktop/dev/projects/pid2 % java --list-modules java.* jdk.* The VSCode home setting for the JDK is: "java.home": "/Users/stephane.eybert/.sdkman/candidates/java/current", and it is the version: ~/Desktop/dev

Is it possible to use SharedSecrets across Java modules?

主宰稳场 提交于 2020-05-15 04:10:41
问题 Given: Modules A and B , where B imports A . Module A exports external.class1 . It defines but does not export external.class1.secretProvider , internal.SharedSecrets and internal.class2 (more on these below). Module A uses the SharedSecrets mechanism to grant external.class1 access to private methods in internal.class2 using external.class1.secretProvider . I wish to grant external.class3 (defined in Module B ) access to private methods in internal.class2 but seeing as internal.SharedSecrets