java-11

Signing java 11 jar with jarsigner duplicate entry module-info.class

北慕城南 提交于 2019-12-05 09:58:13
Hi I am new with java modules so this might be a dumb question. I was trying to sign my jar file with keystore and got the following error. user@Ubuntu:libs(master)$ jarsigner -keystore keyStoreFileName Test.jar alias Enter Passphrase for keystore: jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: module-info.class I couldn't find any documentation of how to avoid this. So I did jar -tf to check the content of the jar and yes, it does have multiple module-info.class files Is there any option to combine them? and how? my module-info.java contains the following. module

spring with jlink, moditect and java 11

六月ゝ 毕业季﹏ 提交于 2019-12-05 09:36:55
问题 thanks to pupeno for his precedent work on spring and moditect that helped me for most of my problem on the subject, however I'm blocked a bit further that he was. my problem is the illegal access exception my poc is available on github I used to add this bit of code to make it work with intelliJ IDEA : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <compilerArgs> <arg>--add-opens java.base/java.lang

JAXB ClassNotFoundException Building Spring Boot App 2.2.0 with Java 11

泄露秘密 提交于 2019-12-05 09:04:59
I've created a Spring Boot application using version 2.2.0.BUILD-SNAPSHOT with Java 11 (POM below): <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.BUILD-SNAPSHOT</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId

Gradle for Java 11 with Modules

我们两清 提交于 2019-12-05 09:03:46
I'm trying to run a sample JavaFX app on Mac OS. build.gradle apply plugin: 'java' apply plugin: 'application' repositories { mavenCentral() } dependencies { compile "org.openjfx:javafx-base:11" compile "org.openjfx:javafx-graphics:11" compile "org.openjfx:javafx-controls:11" } compileJava { doFirst { println "CLASSPATH IS $classpath.asPath" options.compilerArgs = [ '--module-path', classpath.asPath, '--add-modules', 'javafx.graphics' ] classpath = files() } } Java class package com.test; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label;

Compilation fails for JDK 11 and compiles fine for JDK 8

淺唱寂寞╮ 提交于 2019-12-05 06:25:35
The code compiles fine with JDK 8 (1.8.0_212) but fails to compile using JDK 11 (11.0.3) both Oracle jdk and open jdk (aws corretto) Tried compiling using javac and with Maven (maven version 3.6.1 and maven-compiler-plugin version 3.8.0) it compiles for JDK 8 and fails for JDK 11. import java.net.URL; import java.util.List; import java.util.ArrayList; import java.util.Arrays; import java.util.function.Function; import java.util.stream.Stream; public class AppDemo { public static void main(String[] args) { // NO error here giveMeStream("http://foo.com").map(wrap(url -> new URL(url))); List

Replace access to sun.misc.VM for JDK 11

故事扮演 提交于 2019-12-05 03:44:53
In OpenJDK 8, it was possible to access sun.misc.VM and call isDirectMemoryPageAligned and maxDirectMemory . isDirectMemoryPageAligned is used to size correctly the direct memory to allocate, as done by DirectByteBuffer . maxDirectMemory is used to report memory statistics as well as access giving the value configured for -XX:MaxDirectMemorySize . Internally, it will set a limit to the allowed consumption of direct memory. Since OpenJDK 9, the class VM has been moved to jdk.internal.misc and is not available unless --add-export java.base/jdk.internal.misc=xyz is used when running the

OpenJDK 11 java.lang.ClassCastException: class sun.font.CompositeFont cannot be cast to class sun.font.PhysicalFont

爷,独闯天下 提交于 2019-12-05 02:45:17
问题 i running on Linux my junit test with openJDK 11 and got following error: java.lang.ClassCastException: class sun.font.CompositeFont cannot be cast to class sun.font.PhysicalFont (sun.font.CompositeFont and sun.font.PhysicalFont are in module java.desktop of loader 'bootstrap') at java.desktop/sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1086) at java.desktop/sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:965) at java.desktop/sun.font.SunFontManager

When JRE was completely discontinued as a separate offering?

寵の児 提交于 2019-12-04 23:49:23
问题 Starting from Java 9 the module system was introduced, making provision of JRE separately redundant . Through, it seems that it was still possible to download it. For example, from here now Java 9 archive Also, here it's only stated that : Restructure the JDK and JRE run-time images to draw a clear distinction between files that developers, deployers, and end-users can rely upon and, when appropriate, modify, in contrast to files that are internal to the implementation and subject to change

Does Java 11 or 12 supports Struts 1.3?

烈酒焚心 提交于 2019-12-04 20:46:44
Am trying to upgrade maven Struts 1.3 built using Java 1.7 to Java 1.8 and was able to successfully launch the application after changing all possible library files. Now, it has been instructed to upgrade the application to Java 11 or 12. Does Java 11 or 12 supports Struts 1.3 ? Can I proceed to make this changes? Your thoughts please. 来源: https://stackoverflow.com/questions/56521038/does-java-11-or-12-supports-struts-1-3

CXF codegen maven plugin doesn't work OpenJDK 11

∥☆過路亽.° 提交于 2019-12-04 18:56:50
问题 I have been working with JDK 9 & 10 and CXF codegen plugin 3.2.5 and 3.2.6 with no problems but, today I'm trying to update my codebase from Oracle JDK 10 to OpenJDK 11 build 28, but I'm always getting the same error: [INFO] Error occurred during initialization of boot layer [INFO] java.lang.module.FindException: Module java.xml.ws not found [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ---------------------------------------------