Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: false error with jdk7

I've been having a problem with eclipse that's been stressing me a lot. Whenever I start a new Java porject, everything goes smoothly and perfect, until I "clean" the project (Project -> Clean...) and everything goes to @#~%&...
I keep getting:

  • XYZ cannot be resolved to a type
  • Multi-catch parameters are not allowed for source level below 1.7
  • <> operator is not allowed for source level below 1.7

That's very nice, only that I am importing all required classes and I do have 1.7 since the begginig. It's the only version I've installed. I've already tried this and other similar responses for the last few days with no avail.
A solution was to create a new project, copy and paste all packages/clases, which worked for a while, but I added UMLet to the project and again... Removing UMLet plugin did nothing for me.

BTW, even with the "errors", my project runs without any problem, therefore I know they're not real. I could keep working, but then, I can't see when a real error arises... Does anyone got a final solution to get rid of this false errors?

EDIT: I forgot to mention that I'm working with Kepler.

EDIT 2:

Here are screen captures with the requested information.

Java Build Path

Java Compiler

like image 470
ZamPrano Avatar asked Jan 29 '26 11:01

ZamPrano


1 Answers

You can solve this by setting up correct JRE environment in Eclipse as below.

  1. Go to Project => Properties => Java Build Path
  2. Click on Libraries
  3. Select JRE System Library
  4. Click on Edit button at right hand side
  5. Set Execution Environment to Jave SE-1.7(jre7)
  6. Clean project or refresh project.
like image 194
Yogesh Varal Avatar answered Jan 31 '26 07:01

Yogesh Varal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!