2

I have read many threads in stackoverflow but I didn't get the answer.

I used JSmooth and Launch4j but what I want exactly is to get a final .exe file from my JAR application and a JRE so that my windows client won't need to install any JRE (in another way: to get a portable application with its own JVM)

I found that is not possible but why? Does that need the compilation fo the jre with my application source? I hope my question is clear, any help will be appreciated.

Houssam Badri
  • 2,441
  • 3
  • 29
  • 60

1 Answers1

3

Zip the JRE folder and include it as a resource in your .exe file.

At run time, you'll need to extract that resource to the disk, unzip it and then invoke it using ShellExecute to run your .jar file. The size of your executable will probably be quite huge.

This is your only viable solution.. Otherwise, if it is for windows only, why not just write the whole application in C++? Is there a reason why you need your JRE with the application? Why not let the user install their own JVM?

Brandon
  • 22,723
  • 11
  • 93
  • 186