Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 427468

Summary: [1.8][compiler] can't resolve java.lang.annotation.Annotation from source
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: srikanth_sankaran, stephan.herrmann
Version: 4.4   
Target Milestone: BETA J8   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 419331    
Bug Blocks: 427787    
Attachments:
Description Flags
noJREonClasspath.zip none

Description Markus Keller CLA 2014-02-05 08:46:12 EST
Created attachment 239658 [details]
noJREonClasspath.zip

The Eclipse compiler can't resolve java.lang.annotation.Annotation from source any more.

Since bug 419331, I get a compile error "The type java.lang.annotation.Annotation cannot be resolved. It is indirectly referenced from required .class files" when I try to compile the attached project. When I revert the change for that bug, then the Annotation type is found, and I get better (expected/solvable) problems. (The given project is very incomplete but shows the issue).

Background: I'm trying to regenerate rtstubs18.jar for the JDT/UI tests, so that it includes the APIs from latest JREs. We need this e.g. for the test case in bug 425183 comment 10.

ECJ should generally be able to compile a complete rt.jar from source.
Comment 1 Srikanth Sankaran CLA 2014-02-16 16:50:54 EST
(In reply to Markus Keller from comment #0)

> ECJ should generally be able to compile a complete rt.jar from source.

Hmm, we are not hitting this problem in https://bugs.eclipse.org/bugs/show_bug.cgi?id=427787, unless 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=428307 has something to with this.

Stephan, something to bear in mind.
Comment 2 Srikanth Sankaran CLA 2014-02-16 21:10:07 EST
Apparently happens only on ECJ runs without JRE - In the IDE we are building with
rt.jar in the build path with class path order ensuring that sources get
picked up first - that could explain it.
Comment 3 Srikanth Sankaran CLA 2014-02-17 14:20:18 EST
Thanks Markus,

Fix and test released here:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=78bbbeed8347e023a39893a354552d3196a82094

Basically I mended the original fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=419331 to not
overeagerly try to resolve jlaA.
Comment 4 Markus Keller CLA 2014-02-18 10:32:41 EST
Thanks. Verified in BETA_JAVA8 that the project from comment 0 doesn't stop with that error any more, and that I can compile the full rtstubs18.jar again.