java-11

How to read the body of a HttpRequest in Java 11?

微笑、不失礼 提交于 2020-04-11 17:22:15
问题 In a test, I'd like to look inside the body of a HttpRequest. I'd like to get the body as a string. It seems that the only way to do that, is to subscribe to the BodyPublisher but how does that work? 回答1: This is an interesting question. Where do you get your HttpRequest from? The easiest way would be to obtain the body directly from the code that creates the HttpRequest. If that's not possible then the next thing would be to clone that request and wraps its body publisher in your own

Exception in thread “main” java.lang.VerifyError: Bad type on operand stack Java 8 121 but not on Java 11

☆樱花仙子☆ 提交于 2020-04-11 08:34:57
问题 I know that a fix was made on Java 8 Build 75 https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8006684 and i cannot reproduce the same problem with the code that break on version before 75 But this code is throwing the exception on Java 8-121 but not on Java 11 i want to know in which version of the Jdk was this problem solved please. A example this code was generating the problem on versions before 75 but not afterwards. public static void main(String[] args) { xxx(); } static void xxx()

Bundle in JavaFX when you run the executable from a Gradle project?

回眸只為那壹抹淺笑 提交于 2020-04-07 08:03:46
问题 Over the past few days I've been tearing what's left of my hair out trying to get to the Holy Grail: Gradle + Java 11 + JavaFX + writing all my app and testing code in Groovy, not Java. One of several problems is that Groovy 2 (even Groovy 3) can't yet cope with Java 9+ modules, which rules one clever solution out. But I have managed to get a Gradle project together which not only does virtually everything successfully, including the "run" task (from the "application" plugin), and runs tests

JDK 11 + JUnit 5 + Jigsaw: Junit fails to run tests for `module-info`

☆樱花仙子☆ 提交于 2020-03-22 06:41:06
问题 I try to use JUnit 5 in a Gradle project. compileJava and compileTestJava both succeed, but test fails with the strange message Could not execute test class 'module-info'. (message from stacktrace): > Task :test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':test'. > There were failing tests. See the report at: file:///Users/axel/git/utility/build/reports/tests/test/index.html The test result file hints me that " failed to execute tests ", but

Where to put JAXB dependency for compiling Android Databinding on Java 11?

对着背影说爱祢 提交于 2020-03-01 04:54:44
问题 I am using Android Data Binding, and while things were simple it was working very well. However, once I added a BindingAdapter annotation, my project stopped building in Android Studio with an error Execution failed for task ':app:compileSaferesourceDebugJavaWithJavac' , but it didn't give me any more detail. Running gradlew build on the command line showed that the actual error was java.lang.ClassNotFoundException: javax.xml.bind.JAXBException . This makes sense, because this development

Where to put JAXB dependency for compiling Android Databinding on Java 11?

别来无恙 提交于 2020-03-01 04:54:09
问题 I am using Android Data Binding, and while things were simple it was working very well. However, once I added a BindingAdapter annotation, my project stopped building in Android Studio with an error Execution failed for task ':app:compileSaferesourceDebugJavaWithJavac' , but it didn't give me any more detail. Running gradlew build on the command line showed that the actual error was java.lang.ClassNotFoundException: javax.xml.bind.JAXBException . This makes sense, because this development

Java 9: AES-GCM performance

独自空忆成欢 提交于 2020-02-26 12:11:48
问题 I have run a simple test to measure the AES-GCM performance in Java 9 , by encrypting byte buffers in a loop. The results were somewhat confusing. The native (hardware) acceleration seems to work - but not always. More specifically, When encrypting 1MB buffers in a loop, the speed is ~60 MB/sec for the first ~50 seconds. Then it jumps to 1100 MB/sec, and stays there. Does JVM decide to activate the hardware acceleration after 50 seconds (or 3GB of data)? can it be configured? Where can I read

Swing looks zoomed after upgrading java

被刻印的时光 ゝ 提交于 2020-01-24 01:52:06
问题 I have a old application running a Swing client. I upgraded from Java 7 to 8 a long time ago. The upgrade went fine. Ever since I have wanted to upgrade to Java 9, then 11 and now 13. However this is where I meet problems. The UI looks fine and as intended with Java 8, but any newer Java version will somehow change the font sizes and maybe components for some reason. I do not have any pictures to show because the application is maintained on a network without internet access because of

Version check with --version and -version in Java 8 and Java 11

邮差的信 提交于 2020-01-23 18:54:07
问题 Java 11 JAVA_HOME : C:\Program Files\Java\jdk-11.0.4 I was able to find Java version in cmd with following command: java --version //successfully executed java -version //successfully executed Java 8 JAVA_HOME : C:\Program Files (x86)\Java\jdk1.8.0_231 I was able to find Java version in cmd with following command: java -version //successfully executed while I was unable to find java version with --version command java --version //not successfully executed Why I get error that Java Virtual

Cannot add jdk11 and jdk13 in SDK in IntelliJ - java

ⅰ亾dé卋堺 提交于 2020-01-23 17:11:52
问题 I cannot add jdk11 and jdk13 in intelliJ as SDK. I am able to add jdk-18.0_22 only. Why is that so? 回答1: Based on the comment from @MarsAtomic, I would guess that your version of Intellij (14.1.4) is too old to use the new versions of java. 14.1.* was last released on May 11, 2016. JDK 11 reached General Availability on 25 September 2018. 回答2: The implication of Java 11 in IntelliJ IDEA 2018.2 is that you need to use Intellij IDEA 2018.2 or later to work with Java 11. I expect that one reason