Listener Code implementation : Annotation error | Community
Skip to main content
srikanthbiradar
Level 2
October 16, 2015
Solved

Listener Code implementation : Annotation error

  • October 16, 2015
  • 4 replies
  • 1193 views

Hi Friends,

I am trying to write a listener code that triggers a message in the log file, whenever a page is activated. I have attached the code FY reference.

I have used Eclipse with JDK 1.6 as compiler and Maven to build the project. Build is successful and I have checked in the corresponding JAR file to CRXDE using vlt tool. When I click on build bundle, I get the error message below. Wherever I have used annotation, it shows errors.

"Syntax error, annotations are only available if source level is 5.0"

I wanted to try with Java 1.5 version. But some strange reason, the jdk 1.5 64 bit dump from oracle site itself is not working. So, I cannot install that version in my machine to check. I have tried in various machine but did not work.

Is AEM supported only with 1.5 java version ? Annotations are supported in 1,6 as well then why do you think I get that message. Please help.

Do I need to put all the JAR files under Maven dependencies in Eclispe's project structure ???

Let me know anything else is needed.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

AEM 6 supports Java 1.7. See:

https://docs.adobe.com/docs/en/aem/6-0/deploy/technical-requirements.html#Java Virtual Machines

4 replies

edubey
Level 10
October 16, 2015

Which AEM Version you are using ?

What values do you have in you bundle pom.xml at this place

<configuration> <source>1.7</source> <target>1.7</target> <encoding>utf-8</encoding> </configuration>

Any special reason why you are not deploying jar using eclipse to crxde?

Only CQ 5.4, CQ 5.3 supports JDK 1.5

edubey
Level 10
October 16, 2015
It does not support oracle jdk 1.6 Chech here https://docs.adobe.com/docs/en/aem/6-0/deploy/technical-requirements.html#Java Virtual Machines
srikanthbiradar
Level 2
October 16, 2015

Thanks for the response.

I am using Adobe Experience Manager, Version 6.0.0 . 

Yes, I have 1.6 in POM as well. 

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
      <source>1.6</source>
      <target>1.6</target>
      <debug>true</debug>
    </configuration>

  </plugin>

 

Thanks again

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015