Using Eclipse IDE:java.lang.NoClassDefFoundError: main
Hi
Code:
package Try;
import java.io.File;
public class Try
{
public static void main(String args[])
{
String tmp=System.getProperty("user.dir");
System.out.println(tmp);
}
}
The above code works fine when i compile and run it in command line window.
When I run the same code in Eclipse IDE 3.4.1.
"Could not find the main class.The program will exit" and in the console of the IDE I get this
Code:
java.lang.NoClassDefFoundError: main
Exception in thread "main"
So I went throu previous threads.Try to set the class path in two places.One in the properties window of the package and other was in the run configuration.
I even tried the clean option as suggested in blogs,so that i could build the .class file,newly.
But nothing is working i get the same error..
Any suggestions ? or am i missing something..
Need help immediately