-1

I am using eclipse and i get this error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem:     
at Wall.main(Wall.java:6)

her's a screen shot"http://postimg.org/image/ufvv9p6aj/"

Here is the code:

import becker.robots.*;
import javax.swing.*;

public class Wall
{
    public static void main (String[] args)
    {
        JFrame frame = new JFrame ();
        frame.setVisible(true);
        JPanel panel = new JPanel ();
        panel.setVisible(true);
        frame.add(panel);

        JColorChooser color = new JColorChooser();
        panel.add(color);


    }
}
PM 77-1
  • 12,933
  • 21
  • 68
  • 111

2 Answers2

1

The error means you are trying to use s method which doesn't compile. Turn this feature off and look at the compilation error.

you don't appear to be using the becker library so it doesn't matter if you had incorrectly imported it.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
0

Duplicating my answer from the duplicate post:

Your problem is that becker.jar is just listed in your source folder (it is not source, it is a compiled jar and therefore should be in a lib folder, and then added to the Build Path). Eclipse can't find your import becker.robots.* because it doesn't know about becker.jar. Move becker.jar to /lib/becker.jar, and then Right Click on your Project Folder > Properties > Java Build Path > Libraries Tab > Add Jar > (select your lib/becker.jar). That should resolve your compilation error.

A side note - the reason the error shows up as line 6 is because that is where the main method is (this is what actually is being run when you try to run the application), and when attempting to run the main method it identifies the build error that is really on line 1

Community
  • 1
  • 1
guydog28
  • 1,307
  • 1
  • 11
  • 15