External JAR in AEM project | Community
Skip to main content
hitesh_m
Level 3
April 4, 2016
Solved

External JAR in AEM project

  • April 4, 2016
  • 2 replies
  • 3444 views

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. 

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 kautuk_sahni

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

2 replies

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
April 5, 2016

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
edubey
Level 10
April 5, 2016

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.