|
|
|
|
|
|
|
|
|
|
Re: Xtend generated code uses Java8 API's even though the project is still JavaSE-1.7 [message #1777958 is a reply to message #1461307] |
Wed, 06 December 2017 14:06  |
Eclipse User |
|
|
|
Hi,
I could solve the issue for my Maven based project builds:
If the project is compiled with Maven, then this issue can be solved by configuring the Maven toolchain plugin in the according projects or parent projects pom.
If you e.g. want to generate Java 7 compliant XText class code but your Maven build runs with a Java 8 or 9 JVM, then you have to configure your toolchain plugin with a Java 7 JRE/JDK reference within the appropriate Maven pom.
The classes generated by XText will then not contain any Java 8 "Consumer" or other non Java 7 available imports.
Note: The toolchain configuration does not replace the java compile version configured for the maven compile plugin - this is must be configured as usual for the maven compile plugin in your pom.
Regarding Maven toolchain config have a look at maven.apache.org/guides/mini/guide-using-toolchains.html
Regards
Markus
|
|
|
Powered by
FUDForum. Page generated in 0.05000 seconds