Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Java7 class files in spite of ExecEnv=1.6
Java7 class files in spite of ExecEnv=1.6 [message #1060749] Tue, 28 May 2013 10:59 Go to next message
Caspar D. is currently offline Caspar D.
Messages: 35
Registered: July 2009
Member
Hi all,

I have an app composed of a set of OSGi bundles, all of which specify

Bundle-RequiredExecutionEnvironment: JavaSE-1.6

But when I start up the application I get

java.lang.UnsupportedClassVersionError: some/class/of/Mine : Unsupported major.minor version 51.0

Now version 51.0 is a Java 7 class file. So a Java 7 file was generated in spite of the RequiredExecutionEnv setting in the manifests. How is this possible?

I've noticed I can override this by setting Preferences>Java>Compiler>Compiler Compliance Level to 1.6, but I don't think that should be necessary. As per http://wiki.eclipse.org/Execution_Environments, the specified environment should be heeded at compile time also, not just at runtime.

(BTW, yes I have a JDK6 installed and configured under Preferences>Java>Installed JREs>Execution Environments>JavaSE-1.6. Not that it should matter. Even if I didn't have a JDK6 at all, I think the RequiredExecEnv in the manifests should be heeded.)

Comments please...

--
Caspar

[Updated on: Tue, 28 May 2013 11:01]

Report message to a moderator

Re: Java7 class files in spite of ExecEnv=1.6 [message #1060759 is a reply to message #1060749] Tue, 28 May 2013 11:45 Go to previous message
Caspar D. is currently offline Caspar D.
Messages: 35
Registered: July 2009
Member
I think I can answer my own question now.

In addition to specifying the RequiredExecEnv in the manifests, one must ensure that every project has "Enable project specific settings" checked under Project > Properties Java Compiler, as well as "Use compliance from execution environment ... on the build path" in the same dialog.

If there's some other magic at work, I'd still like to hear it.

Thanks
--
Caspar

Previous Topic:It works in PropertyPage, but nowhere else
Next Topic:Extending the WST XML Editor to support Expression language autocompletion
Goto Forum:
  


Current Time: Sun Sep 21 16:18:53 GMT 2014

Powered by FUDForum. Page generated in 0.02743 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software