use jars instead exe's
I agree, create jars instead of exe. If you use Eclipse there is a plugin called "fatjar" that I use myself to create jars
http://fjep.sourceforge.net/ but if you
really want to create an self executable exe file you can try this (taken from mindprod)
GeSHi (cpp):
#include <process.h>
int main(void)
{
execlp("java.exe",
"java.exe",
"-cp",
"foo.jar",
"Bar",
NULL);
return 0;
}
Created by GeSHI 1.0.7.20
Or
GeSHi (cpp):
#include <process.h>
int main(void)
{
execlp("java.exe",
"java.exe",
"-cp",
"foo.exe",
"Bar",
NULL);
return 0;
}
Created by GeSHI 1.0.7.20
and after compiling:
rename foo.exe littlefoo.exe
copy /b littlefoo.exe + foo.jar foo.exe
But this still needs the Java JRE to run so i don't see the point of creating an exe above a Jar file.