IncludeBinary for creating EXE out of Java Jar files
Posted: Tue Feb 01, 2005 9:34 am
Code updated for 5.20+
Writing Java means often multiple Jar files and a batchfile to start the
Java program. Multiple files cause version control. To eliminate this problem you can easily convert these files to one executable with help of a small Purebasic Program using the IncludeBinary command.
For the Jar files I used the demo of the Thinlet GUI, that can be found at
http://thinlet.sourceforge.net
Writing Java means often multiple Jar files and a batchfile to start the
Java program. Multiple files cause version control. To eliminate this problem you can easily convert these files to one executable with help of a small Purebasic Program using the IncludeBinary command.
Code: Select all
Procedure LoadJARs()
If CreateFile(1, "demo.jar")
WriteData(1, ?demo, ?demo_end-?demo)
CloseFile(1)
EndIf
If CreateFile(1, "thinlet.jar")
WriteData(1, ?thinlet, ?thinlet_end-?thinlet)
CloseFile(1)
EndIf
EndProcedure
LoadJARs()
RunProgram("javaw","-jar demo.jar","",3)
DeleteFile("demo.jar")
DeleteFile("thinlet.jar")
DataSection
demo:
IncludeBinary "demo.jar"
demo_end:
thinlet:
IncludeBinary "thinlet.jar"
thinlet_end:
EndDataSection
http://thinlet.sourceforge.net