2

I'm working with Eclipse EE IDE 2.0.1 and I have two Java projects A & B. Project B is added as a jar-file to project A. Project A then runs on a Tomcat server.

When running A, and as soon as A accesses B, I get the exception:

...
Caused by: java.lang.Error: Unresolved compilation problem: 
    '<>' operator is not allowed for source level below 1.7

(1) I've set the Project Facets and Java Compiler for both projects to 1.7, the server runtime environment is also 1.7. I've set everything I could find to Java 1.7, including all the steps described here: Diamond operator(<>) not working in java 1.7

(2) Nowhere in my code does the '<>' operator exist like that. I always define the type within the diamond brackets. (see screenshot of the exception) enter image description here

So right now I assume the mistake doesn't lay in my source code... but what's going on here??

Edit: when just running project B there is no such error.

Community
  • 1
  • 1
SuperUser01
  • 199
  • 1
  • 13
  • 1
    You're trying to run code that doesn't compile. Don't do that. Open the Problems view, and fix every compilation error listed before running your code. – JB Nizet Jul 06 '14 at 13:10
  • There are no errors listed in the problem view, both in project A and B. – SuperUser01 Jul 06 '14 at 13:17
  • Something in that statement is the "first effective reference" (or some term like that) to one of the classes in the statement (or one of the classes referenced by the classes in the statement). This causes the class to be "verified", and in doing so it's discovered that it did not properly compile, and apparently some compile-time option allowed the class to still be generated. You need to find the problem class and fix the compile problem. – Hot Licks Jul 06 '14 at 13:29
  • I did not have any compile problems... Well, it seems to me this was some bug in Eclipse. Creating a new Project and copying the classfiles did the job. – SuperUser01 Jul 06 '14 at 14:19

0 Answers0