After having the jar, how to make a starter program (For example, in windows, an exe file) which can start the jar?
Asked
Active
Viewed 905 times
1
-
emmmm the jar should be executable assuming the makefile is correct – Naftali Apr 11 '11 at 22:32
-
this requise JRE on path? right? – user496949 Apr 11 '11 at 22:33
-
1Possible duplicates (a) http://stackoverflow.com/questions/394616/running-jar-file-in-windows (b) http://stackoverflow.com/questions/2622062/batch-file-command-to-run-jar-file – Lucas Zamboulis Apr 11 '11 at 22:35
-
What is the purpose of such a file if you can run jar file directly? – bancer Apr 11 '11 at 23:22
2 Answers
2
You can make a .bat
file to run your .jar
Just create a new text file and write in it:
java -jar "filename.jar"
Save it and rename it to whatever.bat
. Now in Windows you can run that whatever.bat
file and your java program will be run.
Also, JRE has to be installed on the machine you will run this.

Iulius Curt
- 4,984
- 4
- 31
- 55
-
Also, colocate the .bat and the .jar, using `%~dp` to reference their shared parent directory. – Marcelo Cantos Apr 11 '11 at 22:40