java-11

Consuming stack traces noticeably slower in Java 11 than Java 8

旧城冷巷雨未停 提交于 2019-12-02 16:35:30
I was comparing the performance of JDK 8 and 11 using jmh 1.21 when I ran across some surprising numbers: Java version: 1.8.0_192, vendor: Oracle Corporation Benchmark Mode Cnt Score Error Units MyBenchmark.throwAndConsumeStacktrace avgt 25 21525.584 ± 58.957 ns/op Java version: 9.0.4, vendor: Oracle Corporation Benchmark Mode Cnt Score Error Units MyBenchmark.throwAndConsumeStacktrace avgt 25 28243.899 ± 498.173 ns/op Java version: 10.0.2, vendor: Oracle Corporation Benchmark Mode Cnt Score Error Units MyBenchmark.throwAndConsumeStacktrace avgt 25 28499.736 ± 215.837 ns/op Java version: 11.0

Why is the Java 11 base Docker image so large? (openjdk:11-jre-slim)

二次信任 提交于 2019-12-02 15:42:15
Java 11 is announced to be the most recent LTS version. So, we're trying to start new services based on this Java version. However, the base Docker image for Java 11 is much larger than the equivalent for Java 8: openjdk:8-jre-alpine : 84 MB openjdk:11-jre-slim : 283 MB (I'm considering only the official OpenJDK and the most lightweight images for each Java version.) Deeper digging uncovered the following "things": the openjdk:11-jre-slim image uses the base image debian:sid-slim . This brings 2 issues: this is 60 MB larger than alpine:3.8 the Debian sid versions are unstable the openjdk-11

Build executable JAR with JavaFX11 from maven

岁酱吖の 提交于 2019-12-02 10:37:44
I've made a Java app which uses Maven, JavaFX and some other dependencies. Before, it was easy to build an executable jar but since Java11 is modular and does not include JavaFX i just can't build a working one. I've already tried a lot of things but i don't know what i'm supposed to do now. My pom.xml <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <verbose>true</verbose> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin<

JavaFX applications built to target Java 8 - How to keep running with Java 11?

隐身守侯 提交于 2019-12-02 02:30:24
I recently learned about JavaFX not being included in Java 11, and have a question about how this will work. Right now, I maintain an application that targets Java 8, uses mostly Swing but some JavaFX, and has a non-developer user base. Some of those users are on older operating systems, so I'd like to continue targeting Java 8. However, Java 11 comes out next month, and I'm concerned that some of the users on newer operating systems will upgrade to Java 11, and the JavaFX components of the application will cease to work. So what is the best path forward if you wish to continue targeting Java

Groovy JDK 11 disable the WARNING message

孤街浪徒 提交于 2019-12-01 14:38:26
问题 When I run groovy 2.5.3 on JDK 11 its giving warning message. Is there an option to disable this warning message? groovy -e 'print "hi"' WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/home/user/.sdkman/candidates/groovy/current/lib/groovy-2.5.3.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int) WARNING: Please consider reporting this to the maintainers of org.codehaus

Spring-Boot multi module unable to read properties file from another module

徘徊边缘 提交于 2019-12-01 08:54:34
I have searched High and low and still I am unable to find a simple answer to this very annoying problem, I have followed this great guide: JWT with multi service app Everything works great but in the end of the guide we are suggested to create a config-service(module) , which I have done. The problem is that I am unable to override the default configuration of JwtConfig class The project structure is as follows: -config-service | JwtConfig.java \ | resources \ | jwtConfig.properties -other-service (add dependency in the pom file of the config-service) | someOtherclass.java (import the

Does Apache NetBeans 9.0 support java 11?

谁都会走 提交于 2019-12-01 08:15:48
问题 Can anyone say if Apache NetBeans 9.0 support java 11 and if so what are the requirements to make that work? Prensently I can compile and run java 11 code in NetBeans 9.9 but it is underlined with red and the error message is "cannot find symbol ...". Below is the pom.xml file I use: <?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

How to fix jfoenix modules with javafx 11

夙愿已清 提交于 2019-12-01 04:44:44
So I'm adding my requires for module-info.java and finally got my program to load but as soon as tab pane wants to load from jfoenix library this error is thrown. Caused by: java.lang.IllegalAccessError: class com.jfoenix.skins.JFXTabPaneSkin (in module com.jfoenix) cannot access class com.sun.javafx.scene.control.behavior.TabPaneBehavior (in module javafx.controls) because module javafx.controls does not export com.sun.javafx.scene.control.behavior to module com.jfoenix One way you can try fixing this is by adding the vm option for the required export: --add-exports javafx.controls/com.sun

In Java 11 HttpClient how to solve restricted header name: Date

﹥>﹥吖頭↗ 提交于 2019-12-01 04:31:20
The following java 11 code: HttpRequest request = HttpRequest.newBuilder() .uri(uri) .header("Digest", digest) .header("Date", date) .build(); gives the following error: Exception in thread "main" java.lang.IllegalArgumentException: restricted header name: "Date" The problem is that the digest is based on the date, so I cannot simply rely on the http client date, because that will make the digest invalid. I need a way to either set the Date header, or to retrieve the Date header and then set the digest thereafter. Neither seems possible with standard java 11. Bug# JDK-8213189 This is a bug

JavaFX Proguard Obfuscation

折月煮酒 提交于 2019-12-01 03:10:14
问题 I'm struggling with obfuscation of JavaFX application. Using this project as a base: https://github.com/openjfx/samples/tree/master/IDE/IntelliJ/Non-Modular/Gradle Proguard throws this error: java.io.IOException: Can't write [Path\infile.jar] (Can't read [Path\outfile.jar] (Duplicate jar entry [a.class])) Proguard config file: -dontoptimize -dontshrink -libraryjars 'E:\Prog\jdk-11.0.2\jmods' -libraryjars 'E:\Prog\javafx-sdk\lib' # Save meta-data for stack traces -renamesourcefileattribute