I am using eclipse and i get this error--I think it's an error with the way i imported becker.robots

后端 未结 4 1951
刺人心
刺人心 2021-01-29 12:43

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)
相关标签:
4条回答
  • 2021-01-29 13:05

    look here

    make sure there's no error in your code. do you see any red cross marks in your code? If there is then try to put your mouse cursor on the cross and see more details about the problem.

    0 讨论(0)
  • 2021-01-29 13:05

    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

    0 讨论(0)
  • 2021-01-29 13:06

    From the code you posted, line 6 contains no syntax error. I can only guess it's eclipse build problem, maybe you turned off auto compilation on file saving, or eclipse is looking at old version of the class files generated from your code (or maybe you haven't even saved your file)

    Id suggest you save all files, and try a rebuild by doing Project -> Clean (if you set build automatically), or Project -> Build Project (after cleaning it)

    0 讨论(0)
  • 2021-01-29 13:13

    Just create a new file and copy/paste the code there after removing the first unused import. I suspect that there may be some special characters causing that compilation error.

    0 讨论(0)
提交回复
热议问题