2014-02-17 27 views
-1

我在Eclipse中創建了一個.jar文件來調用paint類。當我完成它給了我一個錯誤:如何從另一個.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(); 
    } 
} 

我試圖使在Graphics1main方法,但沒有奏效。

回答

3

添加static關鍵字,以便應用程序有一個有效的切入點

public static void main(String[] args) 
0

法「主」應該是「靜態」