• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

This Compiles, But Won't Run - Why?

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This small program compiles OK, but when I try to run it I get:
"Exception in Thread "main" java.lang.NoSuchMethodErrror - "main"
The program is:

(edited by Cindy to format code)
[This message has been edited by Cindy Glass (edited June 19, 2001).]
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I compiled this and it failed on compilation.
Remove the spaces between the two " | | " operators.
And break FAST_BREAK needs to be changed to break FAST_EXIT.
I then compiled and ran it. No problems!
Hope this helps.
T
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure that the name of the file that this is in is FastBreak.java (capitalization counts).
Make sure when you start the program with
>java FastBreak
that you spell it correctly including capitalization.
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I made the two corrections that le pointed out and it compiles and ran correctly. Lots of printout of number is: and char is: etc.
Therefore it is not the program. It is either your classpath, or the way that you are typing the class name when you invoke the program.
Try adding the c:\jdk1.3.0_02\bin directory to your classpath and move the dot reference to the front of the concatenation.
Then MAKE SURE that you are typing
>java FastBreak
exactly that way. Because for me, it is almost always my fingers causing the problem .
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Originally posted by Cindy Glass:
> Because for me, it is almost always my fingers causing the problem
Technical term for it is "PEBCAK"
And I don't think the spaces between--and I'm typing these without a space between them now--"| |" are Gary's fault: it's the ornery UBB that's doing it.

[This message has been edited by JUNILU LACAR (edited June 19, 2001).]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic