Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
7

How do I fix a "Could not find or load main class Main" error?

SHANEKASNER
SHANEKASNER

Screenshot 2020-08-24 at 11.10.26 AM


Screenshot 2020-08-24 at 11.10.38 AM

2 years ago

Voters

Comments

TopNew
3
PattanAhmed
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

2 years ago
2
Coder100
Coder100

Hello, two ways:

  1. Copy all your code into Main.java
  2. Configure the run button:
    Create a .replit file:
run="sh main.sh"

Create a main.sh file:

javac ExpressionsWithLiterals.java RectangleArea.java java ExpressionsWithLiterals
2 years ago
3
CodeLongAndPros
CodeLongAndPros

Your code needs to be in Main.java

2 years ago
Load more