Community
Participate
Working Groups
I ran into a problem that prevented me from attaching source to the classes in my .zip file. Steps to reproduce: 1. Create a Java project CantAttachSource. 2. File -> Properties... 3. Java Build Path -> Libraries 4. Add External JARs... and select "example.zip" attached to this PR. 5. Attach Source... and select "example-src.zip" attached to this PR. 6. Finish. 7. Browse the class test.HelloWorld from example.zip. You don't see any source!
Created attachment 3014 [details] example.zip ZIP file containing classes
Created attachment 3015 [details] example-src.zip Source file (.java) for example.zip
No problem in 2.1.
Are there any workarounds for 2.0.2?
As long as the example.zip was compiled with debug attributes, it should work. Olivier - can you investigate if this was the case ?
The HelloWorld.class in the example.zip file doesn't contain any debug attribute. The source file attribute is enough, but it is not there. Therefore it failed. I checked that if the file contains debug attributes (default one: source and lines), it works fine. So the workaround is to compile with source file attribute. Ok to close?
Close as INVALID. There is no problem. In 2.0.2 the source file attribute is used to retrieve the attached source. This behavior has been improved in 2.1.