Rohit Bajaj
asked on
Exception in thread "Main Thread" java.lang.NoSuchMethodError: main
Hi,
I have the following piece of code :
When i run it inside eclipse Indigo it gives the following error :
Exception in thread "Main Thread" java.lang.NoSuchMethodErro r: main
Although main is defined correctly in it still its showing the same error.
What could be the reason for this.
I have the following piece of code :
public class ServiceLoader {
public static void main(String[] args) {
System.out.println("hello");
}
}
When i run it inside eclipse Indigo it gives the following error :
Exception in thread "Main Thread" java.lang.NoSuchMethodErro
Although main is defined correctly in it still its showing the same error.
What could be the reason for this.
If memory serves for Eclipse you need to tell it the name of the main class in the run configuration - perhaps it is set to a different class than ServiceLoader?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I solved it myself. None else commented expect one.