Expand my Community achievements bar.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Listener Code implementation : Annotation error

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10
4 Replies

Avatar

Level 10

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

Avatar

Level 10
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

Avatar

Level 2

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

Avatar

Correct answer by
Level 10