Bug 288991
Summary: | Run simple java on eclipse, UnsupportedClassVersionError | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | sangu <sangu.fedora> |
Component: | eclipse | Assignee: | Andrew Overholt <overholt> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | fitzsim, karsten, oliver, overholt, sylvain.pasche |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | 3.3.0-22.fc8 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2007-10-03 18:53:56 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
sangu
2007-09-13 10:18:03 UTC
After Compiler compliance level is set to 1.4., run works well. Initial Compiler compliance level value is 6. <-- this is bug? Click Restore Defaults, Compiler compliance level changes to 1.4. I don't understand. Is ecj generating something that IcedTea can't run? Tom, do you have any idea what's up here? 51 is the 1.7 major version so the code is being built by IcedTea. sangu, what JDK is Eclipse configured to run programs with? $rm -rf ~/.eclipse ~/workspace/ 1. Launch eclipse ( Compiler compliance level 6) 2. Make helloworld project in tutorials (Create Hello World application) 3. Run UnsupportedClassVersionError 1. Window menu -> Preferences - Java - Compiler -> Compiler compliance level 6.0 -> 1.4 2. Run Works well. ----------------- * Compiler compliance level 6 (Initial value) - Run -> UnsupportedClassVersionError * Compiler compliance level 1.4 (Click Restore Defaults) - Run -> Works well. Looks like there are some troubles with IcedTea: it can't run .class files it generates: javac -target 1.7 Hello.java java Hello Exception in thread "main" java.lang.UnsupportedClassVersionError: Hello : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) Updating component. From openjdk/hotspot/src/share/vm/classfile/classFileParser.cpp: #define JAVA_MAX_SUPPORTED_VERSION 50 OpenJDK represents the Java 1.7 development cycle. It's unknown whether a class file format version bump will be required once Java 1.7 is finalized. In the mean time, people shouldn't be building with -target 1.7 (except maybe javac developers), and I expect JAVA_MAX_SUPPORTED_VERSION 50 is a reminder of this. The correct fix here is to make Eclipse build with -target 1.6 rather than 1.7. This is going to be difficult. It turns out it's not difficult at all :) I'm uncomfortable making this change at such a low level, but I guess someone running on OpenJDK can generate 1.7-level bytecode if they so choose by changing their project properties. I've included a patch and a build should show up in rawhide tomorrow (2007-09-27). Can someone please verify that this is fixed in 3.3.0-22.fc8? *** Bug 310571 has been marked as a duplicate of this bug. *** Confirmed fixed in 3.3.0-22.fc8. Thanks, closing. |