What's up with warnings about runtime not being a 'perfect match' to 'RequiredExecutionEnvironment'?

admin

Administrator
Staff member
There is this warning I regularly encounter when working with Java/Eclipse/Maven/OSGi:

Code:
The JRE container on the classpath is not a perfect match to the 'JavaSE-1.6' execution environment

I am on a Java 7 JDK. Most project require (rightly so I think) a lower version than that. For example they will require JavaSE-1.6 or JavaSE-1.5. So in their
Code:
MANIFEST.MF
, these projects will have an entry that looks like this (sample taken from a bundle project of mine):

Code:
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

This will give me the mentioned warning. Now, I know of two possible ways to 'solve' this warning:

<ol>
<li>Replace the current runtime environment for the project with a Java 6 runtime </li>
<li>Change the MANIFEST entry to
Code:
JavaSE-1.7
</li>
</ol>

Both 'solutions' seem completely ludicrous to me. My project does not require JavaSE-1.7. It runs perfectly fine on JavaSE-1.6. Requiring all users of the bundle to have at least Java 7, just because the developer was on Java 7 and did not like the warning seems to me to be the opposite of what you would want. On the other hand, requiring me as a developer to have all versions of Java installed that are listed as required execution environment on projects I work with seems to be almost just as ludicrous. All these projects run perfectly fine on Java 7 so why would I need to have many of them?

Am I completely missing something (in which case I am <a href="http://www.mymiller.name/wordpress/...ainer-on-the-classpath-is-not-a-perfect-match" rel="nofollow">not</a> <a href="http://www.eclipsezone.com/eclipse/forums/t113874.html" rel="nofollow">the</a> <a href="http://www.eclipse.org/forums/index.php?t=tree&amp;th=162762" rel="nofollow">only</a> <a href="http://www.eclipsezone.com/eclipse/forums/t106393.html" rel="nofollow">one</a>), or is this warning really stupid as it is actively promoting developers to set a much higher required execution environment for their projects as would be strictly needed?? Any insight (and hopefully a third way to get rid of this warning) would be greatly appreciated.