我在Eclipse中创建了一个.jar
文件来调用paint类。当我完成它给我一个错误:
JAR export finished with warnings. See details for additional information.
Exported with compile warnings: Graphics/src/G1.java
Jar export finished with problems. See details for additional information.
Could not find main method from given launch configuration.
以下是调用paint方法的代码:
public class G1Starter {
public void main(String[] args)
{
Graphics1 g1 = new Graphics1();
g1.repaint();
}
}
我尝试在main
课程中制作Graphics1
方法但不起作用。
答案 0 :(得分:3)
添加static
关键字,以便应用程序具有有效的入口点
public static void main(String[] args)
答案 1 :(得分:0)
方法'main'应为'static'
public static void main(String[] args)