Exception in thread "main" java.lang.NoSuchMethodError: main this is the error when i run testmain on cmd? tell me what should i do?? i have just started to learn java and i get this error when i try to run simple hello world program.It compiles well but gives up error at run time
This isn't a Java programming forum - it's about the scripting language, 'JavaScript'. The two aren't remotely similar, Java is a cross-platform programming language and JavaScript is a scripting language which allows web pages to be a little more interactive and dynamic. You might want to look for another forum to post your question...?
If you give me your exact code on here I can amend it to work properly. However here is some code I wrote to do a simply hello world program public class helloworld { public static void main() { System.out.println("Hello World"); } } Code (markup):
Also you may want to use a development environment like BlueJ it is a simple to use program that allows you to make java programs and run them quite easily! http://bluej.org/download/download.html
may be it works:- save the file as the name of the class in this case "helloworld" public class helloworld { public static void main(String args[]) { System.out.println("Hello World"); } }