I have created program that takes input from System.in and output to System.out. I create the executable jar and I want to run it without entering java -jar in windows. Is there any way to do this?
I have created program that takes input from System.in and output to System.out .
Share
There are a number of ways to do this. The simplest way is to create a batch (
.batfile) file that invokes it for you. There are also a number of solutions out there that will create a Windows executable from a jar file. Note: these programs don’t compile the byte code, they just create an executable wrapper around the jar. One option is Jar2Exe but there are quite a few. JSmooth is another option I have used before that works quite well. Another advantage to a program like this is you can bundle all dependent jars into the same executable file as well. Some google searching for “jar to exe” should find you one that works for your solution.