Ask coding questions

← Back to all posts
How do I fix a "Could not find or load main class Main" error?
SHANEKASNER


Answered by PattanAhmed [earned 5 cycles]
View Answer
Voters
MadhavshivCS
elysium001
KatherineMahe
ShahinazYasser1
SHANEKASNER
Comments
hotnewtop
PattanAhmed

@SHANEKASNER Hi,
It seems like your code that you have written should be transferred to file name called Main.java
Try!
Thanks!

Hope this helps

Coder100

Hello, two ways:
1. Copy all your code into Main.java
2. Configure the run button:
Create a .replit file:

Create a main.sh file:

CodeLongAndPros

Your code needs to be in Main.java