aspose file tools*
The moose likes Beginning Java and the fly likes Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error" Watch "Error" New topic
Author

Error

mikeshn
Greenhorn

Joined: May 16, 2001
Posts: 3
Hello
WHen I compile my program it doesn't give me an error message. But when I run the program it gives me the error message "Exception in thread "main" java.lang.NoSuchMethodError: main" ..
What kind of error it can be?
Thanks
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
You'll have to set up the classpath
this is what i have in my classpath
set CLASSPATH = .;c:\jdk1.3\bin\;c:\myPackage;
then you can build other folders as subfolders in myPackage and store them all in there you should not have problems after then. It required a reboot on my system.


Val SCJP <BR>going for SCJD
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
"mikeshn",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Mikael Jonasson
Ranch Hand

Joined: May 16, 2001
Posts: 158
You forgot your main method.
All programs must contain one class that has the following:

It's what "starts" the program.
/Mike
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
my mistake sorry , he is right.
Rick Prevett
Ranch Hand

Joined: Apr 16, 2001
Posts: 68
which 'he'? classpath or main?
rick
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Val was mistaken when he thought it was a classpath error earlier. In that case the error would have been "Can't find this class".
Mikael was correct when he said it was probably an error in the signature of the main method since the JVM could not find it to start the program.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error
 
Similar Threads
Returning values from a Java Program
error while executing.. NoClassDefFound error.
Error
Trying to run my first program: java.lang.NoClassDefFoundError
Read Arabic text in Servlet