Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take “JRE System Library” selected by target platform #30

Open
sewe opened this issue Sep 20, 2016 · 1 comment
Open

Take “JRE System Library” selected by target platform #30

sewe opened this issue Sep 20, 2016 · 1 comment

Comments

@sewe
Copy link

sewe commented Sep 20, 2016

Hi,

I hope this is the correct issue tracker for m2eclipse-tycho as found at http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.9.0/N/LATEST/.

I have an eclipse-plugin project, whose Bundle-RequiredExecutionEnvironment is JavaSE-1.7. This project is supposed to build one of two eclipse-target-definition target platforms. One target platform (mars) has an execution environment of JavaSE-1.7 and the other (neon) has an execution environment of JavaSE-1.8. Also, the mars target platform contains a library that requires JavaSE-1.7, whereas the neon target platform contains a newer version of said library that requires JavaSE-1.8.

The problem occurs if I Import > Maven > Exisiting Maven Project my eclipse-plugin project with the neon target platform selected in its POM.

The Tycho m2e connector configures a project-specific compiler compliance level of 1.7 (good), but also a JavaSE-1.7 “JRE System Library” based on the project's Bundle-RequiredExecutionEnvironment (bad).

This is a problem because I now get compilation errors:

The type java.util.function.Supplier cannot be resolved. It is indirectly referenced from required .class files

The project’s code itself does not use any Java 8 feature, but the newer version of the library does. IMHO, the JRE System Library” selected should be taken from the target platform rather than the Bundle-RequiredExecutionEnvironment header. Or am I mistaken?

@briandealwis
Copy link

I hit this same problem but with pure PDE. The workaround is to open Preferences > Java > Installed JREs > Execution Environments and change the JavaSE-1.7 EE to use a JavaSE 8 JRE.

I don't think it's anything Tycho or m2e-tycho can fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants