Do you have an executable jar, (packed with external libraries), how to implement it on a server that does not have Java / JRE


The server in question is a windows server, and I plan to run the program with a batch file on the command line. However, the server does not have Java installed, so is there a way for me to package the JRE(or whatever Java needs to run the program) into the jar file? Do I need extra applications/programs on the server?

Extra Info: I packaged the jar file using eclipse, has around 3 external libraries, and works fine on my computer (that has Java installed).


You can distribute JRE with your JAR but you cannot pack JRE into jar. You should also take care of an execution script which would set up the appropriate environment variables and start your jar after that.

Below is the possible structure of the distribution pack:

-- App folder
+-- JRE folder
|   |
|   +-- bin
|   |
|   +-- etc..
|-- your jar
|-- execution script (e.g. start.bat)