I have a program that I want to run as an exe on a clients computer. After I made my program in Java I used Jsmooth to create the exe. The program runs perfectly fine from my own local computer, but when I try running the same program on another computer the program prompts me to install Java. After installing Java, the program STILL wants me to install Java. I thought it might be different versions of Java, but I compiled the Jar with the most LTS of Java, and my JRE was on the most recent version. What should I do?
-
is the environment varaible JAVA_HOME set ? – jhamon Mar 11 '22 at 13:48
-
Does this answer your question? [JSmooth Java 1.4 or above not found error](https://stackoverflow.com/questions/10153176/jsmooth-java-1-4-or-above-not-found-error) – jhamon Mar 11 '22 at 13:50
1 Answers
JVMs are quite large. Out of the box, JSmooth therefore doesn't include one. I think you can ask it (I'm recalling exe4j perhaps, a different tool that does the same thing as jsmooth), by stating which path contains one relative to the executable. You cannot fold it straight into the exe, though. It'll then be an installation process where you end up with:
C:\Program Files\AnthonysAwesomeApp\Anthony.exe
C:\Program Files\AnthonysAwesomeApp\jre\lib\rt.jar
C:\Program Files\AnthonysAwesomeApp\jre\bin\java.exe
... and the other 5000 files of a JRE installation
Where 'Anthony.exe' is made by JSmooth, and you told JSmooth that it should use the JRE found in location ".\jre"
.
That should probably still work.
The more general problem is that the entire deployment model is more or less obsolete; JREs do not exist anymore, at least, oracle/team openjdk has ceased producing them and has ceased mentioning the very concept, but some third party deployers such as Azul still produce them. Java1.8 is the last version that can truly be said to have had the concept of a JRE.
A JDK is a superset of a JRE (It has everything a JRE has, and more), and JDKs still exist, so you should just be able to ship an entire JDK.
The new model is jlink
, modules, and treeshaking, and it doesn't feel like any of the exe maker projects such as JSmooth have been updated for it. In general, java is used a ton on servers, but java on the desktop is not observed that much. If you want to delve into those - you have a lot of reading to do, and the experience is not as smooth (heh) as JSmooth.

- 85,357
- 5
- 51
- 72
-
Yea it hasn't been as smooth (hehe) as I thought it would be. I originally had this application in Python and I would use py2exe in the past, but at the same time I didn't want people to install Python or install Java just to run my application. And if that sounded ignorant, forgive me I'm still learning. I will check out "jlink", and I will also try shipping my application to a JDK. I may not have approached this prudently. – Anthony Behery Mar 11 '22 at 14:06