Is it possible to pack a JVM or JRE with a jar file so that assuming the user does or doesn't have Java installed, it will always resort to the packed JVM. My guess is that it would require some sort of c/c++ program which would take away the multi platform aspect of java. This is fine, as long as the platform is Windows. Also it would be best if the user doesn't get a prompt to install the JVM, the program just launches it and then the application with no prompt for the user to install anything.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
To add up to @home answer on packing a JRE:
jre
directory of your OS (e.g. for Windows:C:\Program Files\Java\jre7
)D:\MyProgram\jre7
)PATH
environment variable (e.g.set PATH=%PATH%;D:\MyProgram\jre7\bin
)If you're not allowed to modify
PATH
, you can just explicitly specifyD:\MyProgram\jre7\bin\java.exe -jar MyProgram.jar
in a startup script.If all you want to support is Windows, what is the attraction of Java (as opposed to, for example, .Net)?
Not according to this user. Ever heard of UAC? If my fully enabled UAC failed to catch that and prompt me, I'd be raising a bug report with MS.
Oracle provides the deployJava.js to ensure that a suitable minimum version of the JRE is installed before running an applet or providing a launch button for java-web-start apps. You might adapt the 2nd function to link directly to the executable Jar.
I am ware of 2 different approaches: