Bug 839997 - Classes are built for target 1.4
Classes are built for target 1.4
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: eclipse (Show other bugs)
17
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Krzysztof Daniel
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 769260
  Show dependency treegraph
 
Reported: 2012-07-13 08:06 EDT by Mikolaj Izdebski
Modified: 2014-01-12 19:27 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-13 08:23:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Eclipse Project 369145 None None None 2012-07-13 08:06:10 EDT

  None (edit)
Description Mikolaj Izdebski 2012-07-13 08:06:10 EDT
Description of problem:
Eclipse has code incompatible with Java 1.4 (for example generics, which were added in 1.5), but produces classes in 1.4 format.

Format 1.4 doesn't have official support for generics, but some compilers (OpenJDK <= 6, ECJ) support generics in format 1.4. Eclipse upstream is abusing this fact and generating format 1.4 classes for "better backwards compatibility".

Since OpenJDK 7, support for generics in class format 1.4 was dropped. See:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7078419
Oracle closed this bug as "Not a Defect", so it will never be fixed.

As a result programs that use Eclipse libraries that have generics cannot be compiled using OpenJDK compiler (ECJ works fine in this case as it still supports generics in 1.4).

This is an important problem because it causes other Fedora packages fail to build from source. Instead of fixing "n" other packages to build with ECJ it is better to fix Eclipse to generate classes in format >= 1.5.

Version-Release number of selected component (if applicable):
eclipse-rcp-4.2.0-0.22.I201205031800.fc17.x86_64

Steps to Reproduce:
I have prepared a reproducer:

$ cat Hello.java
abstract class Hello implements org.osgi.framework.ServiceReference<Hello> {}

$ javac -classpath `build-classpath ../../../usr/lib64/eclipse/plugins` Hello.java
Hello.java:1: error: type ServiceReference does not take parameters
abstract class Hello implements org.osgi.framework.ServiceReference<Hello> {}
                                                                   ^
1 error

$ echo $?
1

$ ecj -classpath `build-classpath ../../../usr/lib64/eclipse/plugins` Hello.java

$ echo $?
0

Actual results:
OpenJDK fails to compile the program.

Expected results:
OpenJDK compiler is able to compile the program successfully.
Comment 1 Krzysztof Daniel 2012-07-13 08:13:47 EDT
Hi Mikolaj,
This issue should be fixed in a Juno release 4.2.0-3. It is in the update-testing now.
Comment 2 Krzysztof Daniel 2012-07-13 08:23:32 EDT
The fix is in updates-testing.

Note You need to log in before you can comment on or make changes to this bug.