+ 4
Does a jar file run without a presence of jdk
I have created a jar file successfully and want it to run on other computer. If i copy it through a pen drive and paste it over the other computer than i want to know will it run or not. If it does not run please give me a suitable answer for how can i do so
7 Answers
+ 10
If Java is preinstalled, yes. If not, no ;)
+ 12
You need Java, to be more precise: jre, installed to run a jar file.
+ 10
It is possible to pack your program together with the needed runtime environment so that your program files contain the jre you need to run it. See
https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html
Usually you want to deliver a setup.exe or msi (Windows OS). Then you need to put all needed sources, jre and others, to the setup.
If you want to go that way, I recommend to look into build tools like Maven or Ant, because it will make the deployment much easier once you are familiar with them.
+ 2
Then how are computer softwares of java made because when a computer software is installed at that time no jdk or jre needs to be installed additionaly Tashi N
+ 1
in case if i buy a new computer as it is with default applications and no additional downloads can it be possible Tashi N
0
You'll need JDK in order to develop in Java. If all you want is to run a Java application you will only need JRE. For the case of running a jar file use:
java -jar your_jar_file.jar
0
yes