That sounds far from trivial. Now in addition to your application you also have to maintain your minimal JVM to keep up with the latest developments in the mainstream ones.
I mean it’s not that much more complicated than webpack. You don’t actually have to create your own minimal JVM. But “take the JVM source, remove a bunch of stuff, and then compile” is pretty pedestrian as far as carrying patches for your dependencies goes. There are shops that are running their own modified kernels in prod.