насколько я почитал по данной ошибке, то тут тоже речь идет о переходе на Java 9.
Форумчане, добрые люди. У меня общая задача написать элементарного бота для телеграма.
Можете подсказать, какие версии надо чего установить, чтобы оно все было согласовано с собой по версиям?
Мне сейчас надо написать элементарный диалог и задеплоить его куда-то. Потом уже пойдет какое-то его развитие.
Разобраться с самим кодом я смогу, помогите правильно собрать это все.
Буду рад любому совету по тому. что и какие версий надо установить.
Вот то, что есть по двум файлам.
РОМ :
Код:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kirkaBot</groupId>
<artifactId>bot</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>4.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.13</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>4.0.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</project>
И сам бот:
Код:
import org.telegram.telegrambots.ApiContextInitializer;
import org.telegram.telegrambots.bots.TelegramLongPollingBot;
import org.telegram.telegrambots.meta.TelegramBotsApi;
import org.telegram.telegrambots.meta.api.objects.Update;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
public class Bot extends TelegramLongPollingBot {
public static void main(String[] args) {
ApiContextInitializer.init(); //
TelegramBotsApi telegramBotsApi = new TelegramBotsApi(); //создаем новый объект
try {
telegramBotsApi.registerBot(new Bot());
}
catch (TelegramApiException e) {
e.printStackTrace();
}
}//main
public void onUpdateReceived(Update update) {//метод для приема сообщений получение обновлений через лонгпул
}
public String getBotUsername() {
return "...";
}
public String getBotToken() {
return "...";
}
}//bot
при попытке запуска :
Цитата:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.co re.$ReflectUtils$1 (file:/C:/Users/%d0%9a%d0%be%d0%bd%d1%81%d1%82%d0%b 0%d0%bd%d1%82%d0%b8%d0%bd/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(j ava.lang.String,byte[],int,int,java.security.ProtectionDo main)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.co re.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
|