Y
Y
Yaroslav Ivanov2019-07-15 21:56:09
Java
Yaroslav Ivanov, 2019-07-15 21:56:09

What does the compiler want from me in error: remove(Object,Object) in ConcurrentHashMap?

Good evening java gentlemen!
I am compiling a game assembly in java in eclipse. Everything compiles except for one util folder

Mistake
error: remove(Object,Object) in ConcurrentHashMap cannot implement remove(Object,Object) in Map
public Object remove(Object key, Object value)
              ^
return type Object is not compatible with boolean

The line that swears Javac version: 1.8.0_181 How to fix? The build of 2004 of the authors has long been gone, there is no one to write and it is difficult to google it, since the build of the game itself is specific. They somehow compiled it. Can I install another version of java jdk? PS The assembly itself, despite the error, is perfectly assembled in a jar and launched. Tired of manually transferring the util folder from another assembly. PSS And I decompiled a similar assembly and it says the same in the ConcurrentHashMap.java file.
protected Object remove(Object key, Object value)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Ivanov, 2019-07-16
@space2pacman

Googled the topic
https://mmo-dev.info/threads/%D0%9F%D0%BE%D0%BC%D0...
They wrote there

Do you compile in Java 8+?
public boolean remove(Object key, Object value)
...
The return type has changed there.

Installed version 6 of java and everything compiled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question