I was trying to execute the hello world code in Eclipse by writing main(String[]) : void in main class, but it said Error: Could not find or load main class main(String[]) : void.
Asked
Active
Viewed 31 times
1 Answers
0
What you've provided is only a broken fragment of a Java program. You have not fully defined a class. The most basic Java program looks like this:
public class filename{
public static void main(String[] args){
System.out.println("Hello, World!");
}
}
Use this as a bare minimum for every project, and refer to Oracle's Java documentation.

RutledgePaulV
- 2,568
- 3
- 24
- 47

DripDrop
- 994
- 1
- 9
- 18
-
Please note 'filename' is to be replaced with the name of the main file. – DripDrop Jan 11 '15 at 02:37