rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.77k stars 1.22k forks source link

NoClassDefFoundError for TelegramApiException when trying to execute .jar file #301

Closed atharvjoshi closed 6 years ago

atharvjoshi commented 7 years ago

Hello. When I try to execute my jar file, it does not execute and gives the following error message:

Error: Unable to initialize main class Main Caused by: java.lang.NoClassDefFoundError: org/telegram/telegrambots/exceptions/TelegramApiException

How to work around this issue? Thanks.

Clevero commented 7 years ago

How do you added the jar to your project? maven, gradle? by hand?

Clevero commented 7 years ago

@atharvjoshi is your problem solved?

keeper32 commented 7 years ago

I've built a Servlet-based project using the jar and encontered the same issue when redeploing the project on apache Tomcat. Cleaning/restarting solved it, but it's a bit of hurdle doing it every time you change something in a class. No problems in jetty, btw.

MTaghaddomi commented 5 years ago

image

I have the same problem, I've packaged the project by mvn package. but when I run it this exception throws.

rubenlagus commented 5 years ago

@MortezaTaghaddomi99 Are you setting the classpath so you have all the jar libraries availables?

AlexanderKositsyn commented 2 years ago

i have the same problem. Not solved?

borodatyidrug commented 2 years ago

The same problem. I've already broken my whole head - I can't decide in any way. Everything is according to the instructions from the Maven documentation, but it does not work.