0

I've got a problem with Eclipse Kepler. In my Java project i've got some warnings and now they are shown as error marks (red crosses) in the project explorer.

It looks like this picture https://i.stack.imgur.com/H8j7f.png

So my question is: Is it possible to switch it back to the yellow cross for warnings and red cross for errors? I haven't found anything about it, so I hope you can help me.

Edit:

I've made a test project, and here is a screenshot: enter image description here

Thanks!

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Birdy
  • 355
  • 1
  • 5
  • 15
  • That's strange. I use kepler and I have yellow crosses for warnings and red crosses for errors... – Ben Dale Aug 28 '13 at 13:08
  • Have you looked at your markers and made sure that there aren't also some other markers that really are errors? Little issues like having the wrong Java compliance level (which Eclipse will occasionally reset for fun) can throw up errors on perfectly good code. – chrylis -cautiouslyoptimistic- Aug 28 '13 at 13:11
  • Well that is normally not possible are you sure you have no mistakes. Keep in mind that eclipse mark a variable yellow when you do not use it(like at the screenshot) – Gerret Aug 28 '13 at 13:44
  • this is the entire code of this class. – Birdy Aug 28 '13 at 13:51
  • What is shown in the Problems view? – greg-449 Aug 28 '13 at 14:23
  • just the warning: http://www.imagebam.com/image/102e5a272750703 – Birdy Aug 28 '13 at 14:29
  • I am having a problem that seems similar to this one - https://stackoverflow.com/questions/23818242/eclipse-project-window-shows-error-but-code-editor-shows-no-error – Erran Morad May 23 '14 at 02:10

2 Answers2

1

It might me because you set the compiler to mark as errors what used to be a warning. You can set this in the Window->Preference menu. So open it and go into Java->Compiler->ErrorsWarnings and check if everything is like you want it to be.

You can also check into the compiler menu (Java->Compiler) if the java Compiler compliance level is set as you want it to be as @Chrylis suggested.

Otherwise it might be because your program is unable to compile because of a dependency problem then you might want to check your build path or JRE in the Run configurations menu.

Right click on your project -> Run as -> Run Configurations.

Marc
  • 2,631
  • 1
  • 12
  • 13
  • compliance level is at 1.7, i've changed it to 1.6 (for test) but nothing changed – Birdy Aug 28 '13 at 13:17
  • Did you referenced your JRE in the Run configuration menu ? – Marc Aug 28 '13 at 13:20
  • yes i did. The programm is running without problems. it just shows the red cross – Birdy Aug 28 '13 at 13:22
  • It definitely cannot be due to error/warning settings. A file which contains only warnings and no errors must not be flagged in the Package Explorer with a red mark. – Marko Topolnik Aug 28 '13 at 13:26
  • Yes, you're right. I proposed this because it wasn't this clear at first. Now I really don't know what it could be since it seems like you can't change icons for errors and warning... I can't figure out why it throws an error on a compling and running code... And why the error if it compiles ?! – Marc Aug 28 '13 at 14:06
1

I solved it :)

At the first start I took my old workspace as workspace. Because of that there was an Error "Missing Action set" (I've found the "error log"-window :) ) and thats why the red crosses has been shown.

Now I have a new workspace and now everything is fine!

Birdy
  • 355
  • 1
  • 5
  • 15
  • 1
    Damn, you're right the error log is the first place to look ! I'm glad you solved your problem. – Marc Aug 28 '13 at 15:12