Ask coding questions

← Back to all posts
Java error
Bunnytoes

I am learning java and I decided to convert my bool quiz game that I made in c#, in java. It is almost done, but it says this error: javac -classpath .:/run_dir/junit-4.12.jar:target/dependency/* -d . Main.java java -classpath .:/run_dir/junit-4.12.jar:target/dependency/* Main Error: Main method not found in class Main, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application
please help me fix it.
the full code is

Answered by SixBeeps [earned 5 cycles]
View Answer
Voters
Bunnytoes
Comments
hotnewtop
SixBeeps

Read the error.

Main method not found in class Main, please define the main method as: public static void main(String[] args)

Then look at your code.

See something wrong?

Bunnytoes

@SixBeeps I tried that yesterday but now it works!Thanks

AaronPhilip

Try public static void main(String args[]) on Line 6

AaronPhilip

I forked it and tried it after the change i mentioned above, works fine