TaZe Pug
TaZe Pug

Reputation: 1

(Error) Could not find or load main class

I have been searching for this and nothing has helped, I'm trying to run the main class but keep getting an error. I am running this

java -classpath .\target\classes com.discordbot.Updated_Discord_Bot.Utils.Main

My main file is located in MAIN_FOLDER\target\classes\com\discordbot\Updated_Discord_Bot/Utils/Main.class

I have tried multiple commands and got nothing.

I want to run the main class located in MAIN_FOLDER\target\classes\com\discordbot\Updated_Discord_Bot/Utils/Main.class but keep getting this error, any help please?

Upvotes: 0

Views: 2032

Answers (1)

Mr. Om
Mr. Om

Reputation: 258

I tried java -cp target\classes com.discordbot.Updated_Discord_Bot.Utils.Main from Windows Command Line tool and standing on MainFolder in the CMD tool. The full path is like this

MainFolder\target\classes\com\discordbot\Updated_Discord_Bot\Utils

Where MainFolder is anywhere. All worked fine. What error do you get ? Are you sure all your .class files are generated ?

Upvotes: 1

Related Questions