AEM - Issue while executing java class from Bracket IDE editor | Community
Skip to main content
Level 4
Oct 30, 2019 3:07 AM UTC
Solved

AEM - Issue while executing java class from Bracket IDE editor

Can anyone please help.

i have created a training project package and imported in Brackets IDE , synchronization is sucessfull to AEM and i am able to export back to AEM.

all statement is executing except java class , i am not seeing any error also.

AEMhtmlpreview.PNGHTML AEM UI Page

JAVA Class file

javaclass.PNGJAVA CLass file

HTML File

htmlpage.PNG

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
aemmarc2Accepted solution
Employee
Oct 30, 2019 1:30 PM UTC

... Did you compile the code?

It doesn't look like it.

From the screenshot -- on the left side in the structure pane -- you can't just put .java files inside the content repository and expect it to run. That's not how this works.  Java source needs to be compiled into its CLASS file and those are all magically assembled into a JAR file (an executable program) that adheres to the OSGI specification so it can run inside AEM.

Your Java code needs to be in an AEM maven project and compiled into a deployable artefact.

Start here : GitHub - adobe/aem-project-archetype: Maven template to create new Adobe Experience Manager (AEM) projects that follow b…

The WKND Tutorial is also a good resource to understand how to develop in AEM.

WKND Tutorial Overview

7 replies

Level 4
Nov 6, 2019 6:42 AM UTC

thanks , its fixed

Translate
arunpatidar
New Participant
Nov 4, 2019 6:33 AM UTC

There is an issue with your HTL code.

Please refer below for correct code -

<div data-sly-use.logic="${'Logic' @value1='Adobe', value2='Systems'}">${logic.message}</div>

Translate
Arun Patidar
Level 4
Oct 31, 2019 9:57 PM UTC

thanks arpit

yes i can see the same its getting exported correctly from Bracket to AEM

the moment i give the java class reference in html component of the page i.e it displays the output before the java class reference and stops

any help on this to debug will be helpful

thanks

Translate
Level 4
Oct 31, 2019 9:46 PM UTC

thanks , it helps

Translate
ArpitVarshney
New Participant
Oct 30, 2019 6:33 PM UTC

Hi arunk85184451

I have checked this using aem bracket plugin. I can properly see Java classes in Sync status of bracket.PFB the screenshot

Could you please check it again making sure to use the latest version of Bracket and AEM plugin?

Regards,

Arpit Varshney

Translate
Employee
Oct 30, 2019 3:30 PM UTC

Actually I'm going to correct myself as I believe you can have Java classes that extend WCMUsePojo within the content repository.

Translate
aemmarc2Accepted solution
Employee
Oct 30, 2019 1:30 PM UTC

... Did you compile the code?

It doesn't look like it.

From the screenshot -- on the left side in the structure pane -- you can't just put .java files inside the content repository and expect it to run. That's not how this works.  Java source needs to be compiled into its CLASS file and those are all magically assembled into a JAR file (an executable program) that adheres to the OSGI specification so it can run inside AEM.

Your Java code needs to be in an AEM maven project and compiled into a deployable artefact.

Start here : GitHub - adobe/aem-project-archetype: Maven template to create new Adobe Experience Manager (AEM) projects that follow b…

The WKND Tutorial is also a good resource to understand how to develop in AEM.

WKND Tutorial Overview

Translate