Cannot run bundle compiled by Java 7/8?
I hava aem 6.0 SP1 installed. as said in release note. it supports java JRE 8.
Now I have made a bunlde for one service by maven and intellij. when I use java 8 syntax to make the service and set maven-compiler-plugin to both source and target to 1.8.
The bundle can be deployed in console without problem. but the service in it cannot be called by jsp page. when I tried to call by sling.getService. it returned null. and in the error message:
org.apache.sling.api.scripting.ScriptEvaluationException: \n\tat org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)\n\tat org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)\n\tat org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)\n\tat org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:511)\n\tat org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)\n\tat org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)\n\tat com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilterWithErrorHandling(
I also tried to compile the service bundle in java 7. it still doesn't work. the latest working complier version is 1.6.
So question is: Is the service bundle can only be complied by 1.6? is there any workaround that I can use java 8 syntax to make service bundle?