Error: Main method not found in class Menu, please define the main method as:
public static void main(String[] args)
항상 오류가 발생하며 코드의 모든 부분을 넣으려고했으나 실행되지 않습니다. . 나는 Slick2D를 메뉴로 사용하고있다.클래스에서 main 메소드에 대한 클래스를 찾을 수 없다는 에러가 발생합니다.
다음은 Menu
클래스의 코드입니다.
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
public class Menu {
Image background = null;
Image startGameOption = null;
Image exitOption = null;
float startGameScale = 1;
float exitScale = 1; {
try {
background = new Image("Sprites/MenuBackground.gif");
} catch (SlickException e1) {
e1.printStackTrace();
}
// load the menu images
Image menuOptions;
try {
menuOptions = new Image("Sprites/MenuOptions.gif");
} catch (SlickException e) {
e.printStackTrace();
}
startGameOption = menuOptions.getSubImage(0, 0, 377, 71);
exitOption = menuOptions.getSubImage(0, 71, 377, 71);
}
}
저는 Eclipse도 사용하고 있습니다. 나는 그 오류를 줄이는 것을 결코 멈출 수 없다. 그 오류는 Menu
클래스를 실행할 때 발생하는 유일한 오류이다. 나는 모든 곳을 검사했는데이 오류를 해결하는 데 도움이되지 않는 것 같습니다.