java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
See original GitHub issueHello.
Recently I have this java.lang.NoSuchMethodError
on:
at com.eatthepath.otp.HmacOneTimePasswordGenerator.generateOneTimePassword(HmacOneTimePasswordGenerator.java:140)
at com.eatthepath.otp.TimeBasedOneTimePasswordGenerator.generateOneTimePassword(TimeBasedOneTimePasswordGenerator.java:143)
I guess this is something related to the latest Java 1.8 updated version. Currently I am using:
openjdk version "**1.8.0_312**"
OpenJDK Runtime Environment (Temurin)(**build 1.8.0_312-b07**)
OpenJDK 64-Bit Server VM (Temurin)(build 25.312-b07, mixed mode)
Downloaded on https://adoptium.net/?variant=openjdk8 .
Curiously this wasn’t happening on previous Java 1.8 update version.
I am trying to get more information about it and will update this issue as soon as I have, however could you please take a look on this? Perhaps we have more people facing same issue.
This is the version I am using, which I believe is the latest one:
<dependency>
<groupId>com.eatthepath</groupId>
<artifactId>java-otp</artifactId>
<version>0.3.0</version>
</dependency>
Thanks in advance.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear #117
Hello I started getting this run time error all of a sudden (I upgraded to 0.6.2), but kept java version unchanged.
Read more >java.nio.Buffer not loading clear() method on runtime [duplicate]
In our code we call IntBuffer.clear() and expect it to return Buffer, but in JDK9 they made all Buffer methods return the child...
Read more >ByteBuffer and the Dreaded NoSuchMethodError
java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; at io.debezium.connector.postgresql.connection.
Read more >Binary compatibility issue with Ktor 1.6.5 (affecting JDK 1.8 ...
toByteArray() throws NoSuchMethodError after update to 1.6.6 version on Android ... ByteBuffer.limit(I)Ljava/nio/ByteBuffer when Ktor is built with JDK 9+.
Read more >How to use clear method in java.nio.Buffer - Tabnine
... void call(ByteBuffer buffer) { // this cast is needed in order to avoid // java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A new release is on its way to Maven Central right now.
I believe this should be fixed in #28 (so much for waiting for the weekend). Could you please check out that branch and let me know if things still build as expected for you under Java 8? All of the automated tests pass under Java 8, but given the circumstances, first-hand confirmation would be great, too.
Thanks kindly!