'How to Deploy Spring boot application that uses Matlab Engine APIS and matlab dependency?

I have a Spring Boot Application that uses Matlab Engine APIs to execute a matlab script. I have added in the classpath, the path to the installed Matlab engine jar and then the engine apis can be used from the com.mathworks.engine package. But when creating a jar for deployment, i get : Compilation failure:com.mathworks.engine doesn't exist

Is there any way how jar can be created that references installed Matlab in the deployment machine?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source