I've worked some as an AEM developer which is based on OSGI, and this is where my rudimentary (and a bit outdated) idea stems from. On a new job and completely non-AEM related project, here is what I need to do.
- Build a service library based on a 3rd party library compliant on JDK8
- Deploy them as a spring web-app on tomcat, running on JDK9 or higher.
The 3rd party library is a licensed software and cannot be upgraded because of certain legal impasse. A straight-forward deployment on JDK9 fails because of Java API issues.
The theory is to include the entire JDK8 runtime as bundled dependency and deploy it as a OSGI bundle on a JDK9+ compliant OSGI runtime framework.
Here is a little diagram I created to capture the main idea:
Could this potentially work? In theory this holds because each OSGI bundle uses its own classloader, so the 3rd-party library should not break because of Java API issues. Also, the plan is to use maven to create a fat (uber) jar.
Another question plaguing me: Is creating an uber-jar including the JDK even a thing? I've created uber-jars before, but not sure how I'd include the JDK as well. Some part of that doesn't seem right. Any suggestion?
Thanks everyone!