Expand my Community achievements bar.

SOLVED

External JAR in AEM project

Avatar

Level 3

Hi , 

I have an AEM project setup like this -->

myproject-->components

myproject-->templates

I need to use an external JAR in my project.  For that I created a folder like 

myproject-->install 

and through webdev I placed my jar "helloworld.jar" in install folder.  But I am not able to use this JAR in my component file. Its not resolving the class. 

Any idea. 

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi

You can defiantly convert a jar to an OSGI bundle. As mentioned by scott you need to wrap JAR.

Please have a look at these following links:-

Link:- https://helpx.adobe.com/experience-manager/kb/ConvertAJarIntoOsgiBundle.html

//How to Convert a jar File into an OSGi Bundle

 

Link:- https://helpx.adobe.com/experience-manager/using/aem_wordpress.html

//Live example to convert a external jar to OSGI.  Go to -> Add WordPress Java API Dependencies  

 

Link:- https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

//wrap simple JSON JAR

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

2 Replies

Avatar

Correct answer by
Administrator

Hi

You can defiantly convert a jar to an OSGI bundle. As mentioned by scott you need to wrap JAR.

Please have a look at these following links:-

Link:- https://helpx.adobe.com/experience-manager/kb/ConvertAJarIntoOsgiBundle.html

//How to Convert a jar File into an OSGi Bundle

 

Link:- https://helpx.adobe.com/experience-manager/using/aem_wordpress.html

//Live example to convert a external jar to OSGI.  Go to -> Add WordPress Java API Dependencies  

 

Link:- https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

//wrap simple JSON JAR

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 10

When you setup your project in any IDE, add all external jar dependency in pom.xml of your project bundle. 

And now deploy your AEM project from eclipse to AEM.

This will always ensure all project dependencies are present and resolved wherever you deploy your project.