Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CompletableFuture not found

error:

Java: cannot access java.util.concurrent.CompletableFuture class file for java.util.concurrent.CompletableFuture not found

Imported the library using Maven. Here is the code to start the program:

import org.telegram.telegrambots.meta.TelegramBotsApi;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
import org.telegram.telegrambots.updatesreceivers.DefaultBotSession;

public class Main {
    public static void main (String [] args) {
        try {
            TelegramBotsApi botsApi = new TelegramBotsApi(DefaultBotSession.class);
            botsApi.registerBot(new telegaBot());
        } catch (TelegramApiException e) {
            e.printStackTrace();
        }
    }
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Maybe you use the old java you are trying to run. If you run through the IDE, check with which version of the java IDE you are trying to run. Requires java 8 or higher version

IDE -> ctrl+alt+shift+s -> SDK

try to up jdk version

<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
             <configuration>
                 <source>19</source>
                 <target>19</target>
             </configuration>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading