Include JVM copy in application bundle

I have an OS X objective-c application that programmatically calls a Java command to run a Java program.

If I'm right, Java is no longer installed by default in OS X. I want to send my application, and not force users to download Java before they can use this application.

How can I send a copy of the java executable along with the runtime ( rt.jar ). Of course, I can copy rt.jar to the application package, but what about the java binary? Can I just copy this?

+5
source share
3 answers

I think that in your case, the best option would be to enable the Java Installer kernel (a small installation that downloads and installs the latest version of Java, if necessary).

The main problem with combining binaries in your application is mainly security. Vulnerabilities are discovered in the JRE and fixed. If you linked a specific version, and after its release a vulnerability is discovered, you will mainly weaken the security of the computers on which your application is installed. Since you obviously do not want to do this, it is best to try to turn on the logic to determine if a compatible version is present or otherwise correctly install the correct version. Many installer packages include options such as: For example, OpenOffice / LibreOffice are native applications, but they require Java, and they use the same installation method described above.

+1
source

Each standalone application package includes the following elements:

Application code packed in a set of JAR files, as well as any other application resources (data files, own libraries)

A copy of the JRE for this application only

Custom application program, multiple launchers for one package are supported

Metadata such as icons

Several packet formats are possible. Native support is provided for several types of packages. You can also compile your own packages by post-processing a stand-alone application packaged as a folder, for example, if you want to distribute your application as a ZIP file.

-

Standalone application packages have the following disadvantages:

Download and Run User Interface

Unlike web deployments, user experience is not related to "launching an application from the Internet." This is an easier process to download, install, and run, in which the user may need to complete additional steps to launch the application. For example, a user may need a dialogue with a browser or operating system, or find and run an application installer from a download folder.

Big boot size

In general, the size of the stand-alone application packages is larger than the size of the stand-alone application because a private copy of the JRE is included.

Target Platform Package

Stand-alone application packages are platform dependent and can only be created for the same system on which you are creating. To provide standalone application packages for Windows, Linux, and OS X, you must create your project on all three platforms.

Application update depends on the developer.

Web-deployed Java applications automatically download application updates from the Internet as soon as they are available. The Java Autoupdate engine allows you to update the JRE to the latest secure version several times a year. Offline applications do not have built-in support for automatic updates.

+1
source

You can send a JRE with your application (see license ). To provide the user with a copy of the JRE, enter it and let them install it themselves or create an application package .

0
source

All Articles