Problems in running class java files in ubuntu -
Problems in running class java files in ubuntu -
i have coded java file (party.java) in ubuntu through gedit - java code of file follows:
import java.awt.*; import java.awt.event.*; class party { public void buildinvite() { frame f = new frame(); label l = new label("party @ tim's"); button b = new button("you bet"); button c = new button("shoot me"); panel p = new panel(); p.add(l); } // more code here... }
and compiled code terminal. after doing stuff when tried run party.class through terminal commands:
kirat@virus:~$ cd ~/desktop kirat@virus:~/desktop$ java party
its showing me error message:
exception in thread "main" java.lang.nosuchmethoderror: main
i don't know whether there wrong code. please help me issue
exception in thread "main" java.lang.nosuchmethoderror: main
in core java can execute programme has main method class don't have main method defined can compile class can't execute execution starts main method public static void main
so declare main method in class.
public static void main(string args[]) { //call functions }
java file class ubuntu terminal
Comments
Post a Comment