How do you implement a portable JVM into your program?
So I've heard of programs that have some sort of portable JVM that runs in their program, so it can run on any computer, no开发者_运维问答 matter what, with no dependencies.
How did they do that?
Avian is designed to work this way. You build your app as a native executable for whatever platform(s) you need to support, and that executable contains the VM, an embedded JAR containing your Java classes and resources, and any JNI code your app requires.
If what you're looking for is have a portable version of a JRE, you can just zip your own JRE/JDK and have your program use it.
See my answer on a related question.
精彩评论