We can link with the static libraries of OpenCV, that should do what you
want. And then we can create a single JAR of the result. No need to
write any Java code..
Setting the "compiler.linkpath" property to the path of the static
library on Windows, and adding "-static" to the "compiler.output.prefix"
property on Linux should do the trick, but I haven't tested it, so let
me know if you encounter any problems.
It's probably a good idea to produce only one library file in that case
using the "-o" option of JavaCPP, otherwise we are going to get
opencv_core inside each library file..