I struggle with the problem of distributing applications written in java to computers that do not have java installed.
Unfortunately, exe applications, no matter how I make them, turn out to be extremely unstable:
- IntelliJ IDEA (
exefrom thebundleresultingartifacteven does not always start with me ) - launch4j (
javaw.exeflashes in the processes for only a second;jreis in the folder with the application, this is indicated when creating inlaunch4j) - etc
And I decided that it is easier to force users to install java than to suffer with packaging and other things.
A logical question appears: is it enough to download and install Java ( java.com/download ) so that the application runs stably and without any errors, regardless of whether it is jar or exe , obtained in any of the ways? Or do you need something else to set up, set variable environments and so on?
If necessary, it is necessary to automate it, not all users are able to do this :)
If I think extremely wrong, or I make mistakes, because of which applications become unstable and do not work, please indicate this and, if possible, show how to do it correctly (although I don’t know how I could make a mistake when creating an exe via launch4j by pressing just two buttons).
Also, if there are easier ways to distribute a java application, I will be glad to know.
UPDATE: At first, I just threw the jar from the bundle to the person who has the latest version of java on the computer, it also did not start, then he collected the artifact - jar in IDEA, the resulting file was also dropped - the effect is the same as with the exe file: javaw. exe flashes in the processes for a second, and that's it, the program does not start. This happens wherever the file is located. What is the problem? What am I doing wrong?
jre/bin/java -jar app.jar. That is, in the folder with the .exe there was also .jar with the program itself and the jre folder with the JRE. I would not say that this is the best option (especially for users who already have Java installed), but at least it worked, and I did not see any complaints from users about this. - Regentjava -jar name.jar). - Regent