You mean package the JVM with the application, in case it isn't already installed? The details of how to do that vary by OS, and making sure it works properly on all recent and future versions of Windows, MacOS, Ubuntu, Android, iOS, RHEL, SLES, Raspbian, Arch, the various BSDs, VxWorks, Hurd, and anything other platform that exists now or will exist in the next few decades isn't something I care to do. I just want to be able to write software and have users be able to use it without knowing or caring what platform they're using -- which is what Java was meant to solve, but they never had a broad enough user base that that you could truly hand someone a java binary and trust that it would "just work" for everyone.
(I admit that I'm not very knowledgeable about how Java is used in 2017; there may be some cross-platform solution for distributing Java programs to people who might or might not already have the JVM installed of which I am unaware.)
(I admit that I'm not very knowledgeable about how Java is used in 2017; there may be some cross-platform solution for distributing Java programs to people who might or might not already have the JVM installed of which I am unaware.)