Skip to content
← Back to Community
"Compiler Exit Status 1"
Profile icon
TheMaster7661

Here is my code project for school. I made sure to do everything right, but I still get the same error. Can someone please explain to me what I'm doing wrong?
image

Voters
Profile icon
TheMaster7661
Comments
hotnewtop
Profile icon
TheMaster7661

Thank you, everyone, I fixed it, and it now works!

Profile icon
EpicGamer007

Ok , u did what Six and Coder said. Just so you know, there can only be 1 public static void main(String[] args). If you wanna fix this, change the public static void main(String[] args) in SammysMotto2 to public SammysMotto2

Profile icon
Coder100

Have you tried:

Main.java

class Main { public static void main(String[] args) { SammysMotto2.main(); } }

and then for SammysMotto2.java:

class SammysMotto2 { public static void main() { System.out.println("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"); System.out.println("S Sammy's makes it fun in the sun S"); System.out.println("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"); } }
Profile icon
TheMaster7661

@Coder100
I have tried your ideas, but I still get the same error. maybe you can try to explain what my error means?

Profile icon
Coder100

@NoahJospeh
why are you not calling it as main? SammysMotto2 is a class, and it's a static class so that means there is no constructor. You are going to have to, in your code, have: SammysMotto2.main(); instead

Profile icon
Coder100

it appears you didn't change anything too btw

@NoahJospeh

Profile icon
SixBeeps

Replace Line 3 of Main.java to SammysMotto2.main(args);

Profile icon
TheMaster7661

@SixBeeps
I did what you said, but I still have the same error, am I doing it wrong?