Exception in thread “main” java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer

After searching for a while and verified through switching the installed JDK between 8 and 11, I have found that there are some changes (new overridden methods) applied to several methods (e.g. flip(), clear() ) in ByteBuffer class. In Java 8, while calling flip() method of ByteBuffer class, since it has no implementation for this … Read more

Is there a replacement for the garbage collection JVM args in Java 11?

List of your <arguments, current mapping, reasons> is as follows: -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps ==> decoration options -Xlog:::time,level,tags -XX:+PrintGCDetails ==> -Xlog:gc* -XX:+PrintGCApplicationStoppedTime ==> -Xlog:safepoint Note: PrintGCApplicationConcurrentTime and PrintGCApplicationStoppedTime are logged on the same tag and not separated in the new logging. -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles -XX:GCLogFileSize ==> output options -Xlog::::filecount=5,filesize=1024 The bits that are handled by the framework do … Read more

Consuming stack traces noticeably slower in Java 11 than Java 8

I investigated the issue with async-profiler which can draw cool flame graphs demonstrating where the CPU time is spent. As @AlekseyShipilev pointed out, the slowdown between JDK 8 and JDK 9 is mainly the result of StackWalker changes. Also G1 has become the default GC since JDK 9. If we explicitly set -XX:+UseParallelGC (default in … Read more

Why does the Java compiler 11 use invokevirtual to call private methods?

This was done as part of https://openjdk.java.net/jeps/181: Nest-Based Access Control, so that the JVM can allow access to private methods from nested classes. Before that change, the compiler would have to generate a package-protected synthetic method in the Base class, which the nested class invokes. That synthetic method would in turn call the private method … Read more

Why is Java 14 not LTS?

Take look at this announcement: For product releases after Java SE 8, Oracle will designate a release, every three years, as a Long-Term-Support (LTS) release. This means another LTS (ver. 17) should be 3 years after Java 11, so in September 2021. Java 14, however, was released in March 2020, so no LTS. Java 8 … Read more

Paths.get vs Path.of

Indeed, Path.of was later introduced. Conjecture: it was introduced for the sake of a consistent Foo.of style. From the mailing list archive, this method was once called Path.get: The main changes in are in Path and Paths in java.nio.file. This patch copies the Paths.get() methods to static methods in Path.get() and modifies the former to … Read more

Is there a replacement library for CORBA in JDK 11 [closed]

You can definitely take a look at javaee/glassfish-corba. The documented home page reads – The GlassFish ORB complies with the CORBA 2.3.1 specification, and with the CORBA 3.0 specifications for the Interoperable Name Service and Portable Interceptors. It includes both IDL and RMI-IIOP support. The GlassFish ORB has an open, extensible architecture that supports flexible … Read more

Java Casting: Java 11 throws LambdaConversionException while 1.8 does not

TL;DR The Eclipse compiler generates a method signature for the lambda instance that is invalid according to the specification. Due to additional type checking code added in JDK 9 to better enforce the specification, the incorrect signature is now causing an exception when running on Java 11. Verified with Eclipse 2019-03 as well with this … Read more

How to write code in Java 11, but target Java 8 and above?

While conversion of classes compiled for JDK 11 to JDK 8 would be theoretically possible with a sophisticated tool, it’s not trivial. There are significant changes on the binary level. First, JDK 11 introduced nest types, which eliminates the need to generate synthetic accessor methods when accessing private members of inner/outer classes. Of course, such access would … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)