Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse marks every new project with an exclamation mark

Tags:

java

eclipse

My eclipse marks every new project with an exclamation mark. enter image description here

i tried the steps provided here: Unbound classpath container in Eclipse but no cigar.

i was able to delete java 1.7 and add the old 1.6 but now i get this error:

java.lang.UnsupportedClassVersionError: klasse : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

Exception in thread "main"

im pretty much lost. java seems simply broken to me. maybe i should just reinstall it?

/Edit: since some dont believe me: enter image description here

there is no problem with klasse.java (some other projects have some normal errors that i cannot bother and CSVAufbereitung has the error i had in klasse.java before i followed the steps above.

(thats why i created this question in the first place)

IMPORTANT: i just realized that i only have the jre1.6 installed while having jdk1.7 and jre1.7 installed.

so when i switch back to 1.6 it wont work because i dont have jdk1.6 installed.

silly me. but i would like to keep using 1.7

so the main question is: why is 1.7 not useable anymore ("Unbound")?

Update:

i found out that i can create 1.6 project and they will run without errors.

if i create projects with 1.7 they wont run.

if i then downgrade those projects to 1.6 they still wont run.

since i want to use 1.7 this is quite nagging.

like image 254
Wandang Avatar asked Dec 07 '22 14:12

Wandang


1 Answers

Go to Window > Preferences and check Java > Installed JREs, problem is there...

enter image description here

When you change JRE/JDK, you should perform Project > Clean... to force rebuild, this should help.

This "Problems" view I was writing about

enter image description here

And check Shadark's suggestion about compliance level, 1.6 is what you want.

enter image description here

Check also your project Java build path

enter image description here

There are also project compiler settings if "Enable project specific settings" is checked these settings have higher priority.

enter image description here

like image 88
Betlista Avatar answered Jan 29 '23 10:01

Betlista