• 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

Exception in Thread "main" java.lang.Error: Unresolved compilation problem

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without any indication of what I need to fix, I cannot figure out what's going wrong with this program.  What kind of compiler error could this be?

I may try to run this on another computer to see if it's a configuration or Eclipse version issue.

Attachment contains image of program after trying to run it.  Any idea why the red underlined issues exist?
Capture.PNG
[Thumbnail for Capture.PNG]
 
Ranch Hand
Posts: 127
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post code and error as text instead of a screenshot. This helps users like me on mobile phones with small screens.
 
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
The name of the .java file must match the name of the class exactly, including capitalization. Your file name starts with a lowercase 'o' whereas the class starts with an uppercase 'O'.
 
Christian Antfeld
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bob Winter wrote:Please post code and error as text instead of a screenshot. This helps users like me on mobile phones with small screens.



Sorry, Bob. I'll do that from now on.
 
Christian Antfeld
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:The name of the .java file must match the name of the class exactly, including capitalization. Your file name starts with a lowercase 'o' whereas the class starts with an uppercase 'O'.



Thanks, that solved it.  Now I'm having issues with the displaying of the components after adding them.  More work to do.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please paste your code as it is, then I will able to check your code more better way and can execute in into my system?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christian Antfeld wrote:I may try to run this on another computer to see if it's a configuration or Eclipse version issue.



An important rule of programming: "It's your fault."

Okay, that's not universally true. Bad stuff can happen because of the environment. But the majority of the time, error messages are there because you did something wrong. So the best approach, when you get errors, is to start by looking for what you did wrong.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:. . . looking for what you did wrong.

...which shouldn't be difficult, least of all when Eclipse marks the errors by underlining them in red.

When you get that code to compile, work out why “extends JFrame” is a bad idea.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way, that wasn't a compiler error.
That was a runtime error thrown by Eclipse because you attempted to run code that had compilation problems (those bits in red).
The way to find out what those issues are is to hover the mouse over the underlined bits or the little red crosses in the gutter, or simply look in the Problems tab at the bottom.

Don't bother trying to run code if Eclipse is telling you it doesn't compile.
reply
    Bookmark Topic Watch Topic
  • New Topic