java-9

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

java.lang.IllegalAccessError: cannot access class because module does not export to unnamed module

有些话、适合烂在心里 提交于 2020-06-25 05:55:33
问题 I am currently trying to successfully extract the java.base.java.util.jar package from the jdk-9.0.1, building a .jar out of it and importing the jar as external library into another project, so that I can modify the behavior of some of the methods from the classes contained in it. I seem to be successful at extracting the package, as I am able to eradicate all possible pre-compilation-errors in the project and build the .jar artifact. I can also import this .jar as external library in my

java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

时间秒杀一切 提交于 2020-06-24 08:27:05
问题 After installing JDK9, I get this exception when running my Scala projects. Upgrading Scala to 2.12.2 also didn't resolve my problem. 回答1: The java.xml.bind module is not resolved by default when running code on the module path. This means that if you depend on JAXB then you need to run with --add-modules java.xml.bind or else deploy JAXB on the class path (or module path). Update: The "Modules Shared with Java EE Not Resolved by Default" section of JDK 9 Migration Guide provides more

Create Java DateTime Instant from microseconds

心不动则不痛 提交于 2020-06-13 07:23:48
问题 There has been changes in Java Date & Time API Since Java 9. LocalDateTime now has microseconds precision. Java 9 has a fresh implementation of java.time.Clock capable of capturing the current moment in resolution finer than milliseconds (three digits of decimal fraction). We get the time in microseconds from our backend service. System.currentTimeMillis > 1565245051795 > 2019-08-08T06:17:31.795 Service.getTime > 1565245051795306 > 2019-08-08T06:17:31.795306 In order to construct a

Android - Not able to get microseconds using java.time.Instant

浪子不回头ぞ 提交于 2020-05-14 10:14:33
问题 I am unable to get the microseconds using java.time.Instant (Instant.now()) from android. I am getting the date time without microseconds like 2020-04-10T12:43:40. 442Z from android But when I execute a independent java program, with the use of java.time.Instant (Instant.now()) I am getting the date time with microseconds like 2020-04-10T12:43:40. 442179Z It seems the issue is with java versions in android studio. Please help me to fix this issue. Note: I have installed Android Studio - 3.6.1

Android - Not able to get microseconds using java.time.Instant

情到浓时终转凉″ 提交于 2020-05-14 10:08:51
问题 I am unable to get the microseconds using java.time.Instant (Instant.now()) from android. I am getting the date time without microseconds like 2020-04-10T12:43:40. 442Z from android But when I execute a independent java program, with the use of java.time.Instant (Instant.now()) I am getting the date time with microseconds like 2020-04-10T12:43:40. 442179Z It seems the issue is with java versions in android studio. Please help me to fix this issue. Note: I have installed Android Studio - 3.6.1

how to set jdk.attach.allowAttachSelf=true globally

孤者浪人 提交于 2020-05-10 03:07:12
问题 I am trying to move one of our systems from java 8 to java 9 and about one third of the unit tests that worked OK in java 8 fails with the error below: java.io.IOException: Can not attach to current VM Google took me to a few pages and I quickly understood that in java 9 the default behavior was changed to prevent attaching to the current VM and to go back to the old way you need to set the system property jdk.attach.allowAttachSelf to true. When setting this in IntelliJ the tests work fine.