Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you need java installed to run jar files?

I want to create a executable jar file of a small game that i wrote in java and make it playable in any machine with simple double click like exe file. My question is do you need to install java runtime first in order for executable jar file to work or can it work on a machine without any java installed as well?

like image 244
user3059427 Avatar asked Jul 20 '26 04:07

user3059427


1 Answers

No it can't. However, clients do not require the JDK, the JRE would do. You can make your jar declare its own main class and have users double click it normally like an exe file or create a bat file in Windows.

like image 157
SiN Avatar answered Jul 21 '26 18:07

SiN