This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi, Every body I have a problem with the jdk, when I am going to compiling my java file in Command Prompt I am typing JAVAC name_of_file.java then I can compile but when I am going to run this file I am typing JAVA name_of_file, I cna not run the file it give me this message C:\java test Exceptin in thread "main" java.lang.No.SuchMethodError: main thanks Bashir
Originally posted by Bashir Mirzad: Hi, Every body I have a problem with the jdk, when I am going to compiling my java file in Command Prompt I am typing JAVAC name_of_file.java then I can compile but when I am going to run this file I am typing JAVA name_of_file, I cna not run the file it give me this message C:\java test Exceptin in thread "main" java.lang.No.SuchMethodError: main thanks Bashir
type this: c:\ set classpath=.; then run c:\java urClassFile hope this works
------------------
Bashir Mirzad
Greenhorn
Joined: Nov 28, 2001
Posts: 25
posted
0
Hi Guys I still have the problem, I am using Win2000 and set the classpath .; and I a have the path for jdk like this C:\jdk1.3.0_02\bin, I can compile my program but I can not run that thanks [This message has been edited by Bashir Mirzad (edited December 05, 2001).]
Remove the semicolon from your classpath statement.
Also make sure that if your class is inside a package, that the *.class file is placed inside an appropriate folder structure (one that reflects the package structure).
I'm also moving this to Java In General - Beginners
It could be a problem with your code. In your name_of_file.java file you must define a method called 'main()', and it must be defined like this: public static void main(String[] args) { _your_code } or like this: public static void main(String args[]) { _your_code } If you define 'main()' any other way then it becomes an ordinary method and not the start point for your program.