Skip to main content
Level 3
Apr 27, 2016 6:47 PM UTC
Solved

Maven build fails with Unable to compile class for JSP

I'm trying to build my AEM project with maven but keep hitting this error on the compile-jsp step

Here's the error:

[ERROR] Failed to execute goal org.apache.sling:maven-jspc-plugin:2.0.8:jspc (compile-jsp) on project some-app: Unable to compile class for JSP: [ERROR] An error occurred at line: 14 in the jsp file: /apps/some=app/pages/t18-1_internal_static_content/body.jsp [ERROR] The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

I've read this could have something to do with the java version being used. Here's the info provided by mvn -version

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:37-04:00)
Maven home: /usr/local/apache-maven-3.3.3
Java version: 1.8.0_71, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.4", arch: "x86_64", family: "mac"

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
squid267Accepted solution
Level 3
Apr 28, 2016 12:16 PM UTC

Hi guys! I was able to fix by going in 'Run Configuration" --> 'Maven Build' --> Click on JRE tab and select Jave SE 7 and it worked. Attached a screenshot for reference.

4 replies

smacdonald2008
Level 10
Apr 27, 2016 9:30 PM UTC

For a test - try running JDK 1.7. Let us know what happens. 

Translate
Tuhin_Ghosh
Level 8
Apr 27, 2016 10:56 PM UTC

Hi,

Try to incorporate Scott's suggestion. Also there is a similar kind of error posted in the below community discussion. Please take a look at this and see if it helps.

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.336.html/forum__4zem-hi_i_createdan.html

 

Thanks

Tuhin

Translate
squid267AuthorAccepted solution
Level 3
Apr 28, 2016 12:16 PM UTC

Hi guys! I was able to fix by going in 'Run Configuration" --> 'Maven Build' --> Click on JRE tab and select Jave SE 7 and it worked. Attached a screenshot for reference.

Translate
smacdonald2008
Level 10
Apr 28, 2016 12:22 PM UTC

Thanks for posting this - I have seen issues like his posted in the forums with respect to JDK 1.8. I am still using 1.7 - seems to work better with AEM. 

Translate