"executables" + java

Status
Not open for further replies.

aaronkupen

Fully Optimized
Messages
1,848
Location
Pittsburgh, PA
Jeez ive been making too many threads, but oh well. Is there a program that can transfer your java program into a stand alone executable that i can send to friends so they can open it?
 
Just send them the .Jar files. Jar files are pretty much the same thing as .exe. Except that they run on multiple OSes
 
aaronkupen said:
How do i make a .Jar file
jar cmf main-class jar-file input-file(s)

the c indicates you want to create the file, the f indicates you want to create a file rather than write to std out. the m requires you to specify a main class and is required if you want to make it executable

Jar files are not pretty much the same as .exe's jar files are more like .zip files, although it is possible to make them executable using a command similar to above

you would then run something like:
$ java -jar jar-file-name

you can also add any command line arguments at the end if required.

if using windows create a .bat file that runs this command, if using linux just create a script with the commands in it
 
Status
Not open for further replies.
Back
Top Bottom