[ajug-members] why? NoSuchMethodError: main

Paul Bemowski bemowski at yahoo.com
Thu Aug 9 13:03:47 EDT 2007


Tim - 

Try 
public static void main(...
rather than
public static int main(...

Paul

--- Tim Watts <timtw at earthlink.net> wrote:

> Hi,
> 
> I'm getting this when I run my utilty:
> 
> 	Exception in thread "main" java.lang.NoSuchMethodError: main
> 
> The class has:
> 
> 	public static int main(String[] args) {
> 		return new MakeConfigs.doMain(args);
> 	}
> 
> The class is public:
> 
> 	public class MakeConfigs {...
> 
> And it's in the classpath (otherwise I wouldn't even get this error, of 
> course).
> 
> I tried java -verbose... and it just tells me what jar it found the class in. 
> I'm running under jdk 1.5, it's compiled for 1.4
> 
> Any ideas what could be going on? 
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members
> 




More information about the ajug-members mailing list