Reputation: 2744
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?
Upvotes: 0
Views: 123
Reputation: 35598
There are a number of ways to do this. The simplest way is to create a batch (.bat
file) 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.
Upvotes: 1
Reputation: 14053
On windows a simple double-click on the jar file should open it if the environment is well set.
Upvotes: 0