Typical solutions for reference
Java language is a simple and convenient language, so it is good for tool softwares or game softwares, you can write a useful tool software easily and quickly. Java language is also powerful and stable, so it is also good for server softwares, which will run as a server for a long time stably.
Jar2Exe has many powerful functions to use in different kinds of java redistribute solutions. Here are some advices for typical solutions. The demos here are not only demos, they are also useful tools in practice.
About application types
There are 3 types of applications can be generated by Jar2Exe:
Console type: When this type of application runs, the console window will be attached or created. User can interact with program through console. This type of applications are usually started at command line, with arguments if required.
Windows GUI type: This type of applications are usually started from shortcuts by mouse clicking. When this type of application runs, there is no console window to be created. The outputs of System.out and System.err will not be visible, but the outputs can be redirected to a file or a pipe.
Service type: This type of applications run in background. They can automatically start up when System starts up, without user login. This type of applications usually do a service on the network or do some background tasks.
About Java Runtime Library (JRE)
When generated exe runs, JRE is required. You can select to tell your customers to install JRE by themselves, or you can copy a 'jre' directory along with your program, and pack your program and 'jre' into install file together.
If your software is a small software, which is put online for download, it is preferred to tell your users how to install JRE.
If you want your software can run on a pc without JRE "installed", you can select to copy a 'jre' along with your program and pack them into install file together.
Your java program can be encrypted and hidden into generated exe files, so user cannot extract it from exe file.
In most cases, your program will continue to run normally after encrypted. In certain cases, when your main program or a third-party library uses ClassLoader explicitly, you may need to make a little change to your code, to use another ClassLoader, in order to be compatible with encryption.
About 32 bits and 64 bits
32bits of generate exe files, with 32bits JRE only, can run on both 32bits and 64bits of OS.
Usually, you can redistribute your product as 32bits of exe file with 32bits JRE in order to run on both 32bits and 64bits of OS. If your program uses a memory larger than 1.4G, you must run your program as 64bits of exe file with 64bits of JRE.
Advices with live demos
These are some typical solutions of java program with Jar2Exe.
This advice shows you: How to write a console tool software to run at command line? How to print usage messages? How to prompt user to download java runtime environment?
The demo software is a tool to process svn dump file. It may be useful for someone in special situation. :)
This advice shows you: How to write a window tool software using JSwing? How to show a splash window?
The demo software is a test tool for Regular Expressions in Java.
Background service is running in background. It will continue to run when user logout. It can automatically start up when Sysem starts up without user login. This advice shows you: How to write a service program? How to redirect System.out as daily log files?
The demo software is a ftp server to run as a service.
If you have a webapp (".war") file, and you want to encrypt it and wrap it into an exe file, Jar2Exe can help you do that. This advice shows you: How to compile, encrypt and wrap a webapp step by step? How to run a webapp as a standalone server or run a webapp as a background service?
The demo webapp is copied from Tomcat/webapps/examples.
To encrypt a JavaFX program need some special steps. This advice shows you: How to encrypt a JavaFX program step by step.
The demo software is a calculator using JavaFX.
This advice introduces the differences between Jar2Exe and some other third-party softwares, and how to use Jar2Exe and some third-party softwares together in your solution to let your java program more safe.
This advice introduces how to put generated binary file into an ".app" folder to be a Mac app.
- solutions-all.zip - 11.3M, all solution related files in one file.