I have never seen software released as jar, so how can I make software released as exe?

Does everyone think that everyone else does not release software as a jar, and then release software as exe too?

+4
source share
5 answers

Yes. If you are dealing with end users, not programmers, creating your own solution for its platforms is a good idea. Create dmg, exe and some linux packages. For an exe example, see launch4j or jsmooth .

+5
source

Java software can be released in several ways, depending on the target market.

The simplest for the developer (but the most difficult for the end user) is simply to issue a jar file (or a set of Jar files). In many systems, the JAR will be a “double-click” and thus will be executed. But if the end user does not have Java installed, this will not work.
It’s good if you control the target environment. It’s also good if you want to target Windows, Mac, and Linux right away. Any Java platform can run it, including platforms that you have not considered.
It’s bad if you focus on ordinary users. He cannot "set tasks", configure anything on the Start menu, or associate himself with a file type.

Java Web Start is my preference in most cases. It provides a Java-based installer and can customize the start menu, associate file types and all that stuff. But it creates a security window during installation.
Good for most cases. You have only one link for all OS.
It is bad if you suspect that the user does not have the JRE installed, or you do not want the end user to know that the application is written in Java.

You can free the zip file using the Jars in and the .bat file and the .sh file to gain access.
Good for administrators, developers, and command line applications.
Bad for end users who really don't know what a bat and shell script are, and had no idea what to do if the script was broken for their system.

Thin .exe wrapper around the Jar file. This gives end users the impression that the application is native. They usually come with ...

A installer with Java support . This is a native installer (therefore different installers for Windows, Mac, and Linux). This will determine if Java is installed on the target machine, and if the JRE fails to start. He will also be able to perform all the interesting functions after installation, such as establishing file associations and adding items to the start menu.
Good for most cases. It’s bad if you are targeting multi-level platforms, since you will need to maintain an installer for each platform. It is also bad if one of the target platforms does not have a Java installer installed (then you will need to use the other methods above for this platform).

Source exe . Using the Java-to-native compiler (Jet, GCJ or IKVM), you create your own executable file.
Well, if you really do not want people to know that you are using Java, or you need to integrate with your native environment for some time (ikvm will allow you to use your Java code in .NET as just a .NET object).
It’s bad, because people think that it will magically make the application faster when it isn’t.

A jpm4j . JPM is a package manager for Java, such as npm for nodejs. This allows you to install the software through a small command line script, for example, to install jython you can use jpm install -f --name jython org.python:jython . Good for developer tools. Bad for end users as it is command line based and requires them to install jpm first.

Edit: IKVM, jpm

+15
source

Another alternative is install4j ,

A powerful multi-platform Java installer that generates native application installers and launchers for Java applications.

I downloaded and installed an application that used it, and it worked perfectly. However, its price can interfere with individuals or small companies trying to deploy a small Java application.

+1
source

You can do this yourself by writing a short (C?) Program as follows:

 //run tests here system("java -jar my_file.jar"); 

But you will need to create a version of this executable for each operating system.

+1
source

Depends on who your audience is. If you are writing applications designed to be installed by professional system administrators, I would just make banks. If you are writing to end users without any technical knowledge, it might be the right choice for a system dependent binary.

When using the jar route, I would consider creating two distributions: one of them included all the libraries that the application depends on, and one without them.

As for binary: why not put a thin shell as a batch file or shell script?

0
source

All Articles