aspose file tools*
The moose likes Cattle Drive and the fly likes Please decode error message. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Please decode error message." Watch "Please decode error message." New topic
Author

Please decode error message.

Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
I don't understand this error message. What is it trying to tell me?
Attempt to reference method length in class java.lang.String as an instance variable.
here is the offending code.
int wordlength = args[0].length;

"There are some who call me TIM?"
Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
Never mind I found it. It wanted
args[0].length(); instead of args[0].length;
Now here is a another one.
Starting application F:\Progs\java\repeater\Repeater.class
java.lang.NoSuchMethodError: main
Exception in thread "main" Interactive Session Ended
Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
Never mind again. Found out that the
public void main() had to be static as in
static public void main()
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
That's cool. A thread where someone has answered all of their own questions. This would be a good start for a "Common Problems FAQ" for Java.
I've always desired a "Lessons Learned" doc of some kind wrt Java. . .
Tim Uckun
Ranch Hand

Joined: Jan 19, 1999
Posts: 88
What is really needed is a decent error message. Why can't the error messages be clear? Why can't they tell you exactly what was expected and what was delivered? That way we can try and fix the problem instead of trying to figure out what the compiler is trying to tell us.
Matt Midcap
Sheriff

Joined: Jan 07, 1999
Posts: 440
We're with you brother Tim!


Best Regards,<br />Matt Midcap
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please decode error message.