on 05-20-2015 12:08 PM
I use Hybris 5.1.1 and run it with Java 1.8.
When I use Java 1.8 to compile a java file with a lambda expression, I get the following error:
[yjavac] Lambda expressions are allowed only at source level 1.8 or above [yjavac] ---------- [yjavac] 1 problem (1 error)
When I try in platform/resources/ant/util.xml to change the yjavac task call to add
it says [yjavac] Unrecognized option : -source 1.8
How can I compile Java 8 code?
Aha, that completely changes situation 😉
You shouldn't change anything in util.xml or whatever build related file. The only thing you need to do is to put in your local.properties:
build.target=1.8
build.source=1.8
and recompile. 5.5.1 was transition release so default was still 1.7 but able to compile with target 1.8. Platform 5.6 will come with these settings set to 1.8 (btw without backward compatibility with 1.7). I hope it will help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works perfectly ! Thanks !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry typo I use 5.5.1 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Platform 5.1.1 is not compatible wit Java 1.8. We have provided support for Java 1.8 from platform 5.5.1. The main problem is the fact that if you want to use JDK8 you must use Spring 4, and your version of platform is using Spring 3.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.