question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;

See original GitHub issue

Hello. 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:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jchamberscommented, Nov 20, 2021

A new release is on its way to Maven Central right now.

1reaction
jchamberscommented, Nov 19, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found