0

I would like to wrap an executable jar into a .exe file in order to give it to associate. I used Launch4j and it works. However the others are not able to use it. Error occurs always with Java version.

I found this question:

Running a java program as an exe in Windows without JRE installed

Is there nothing else more easy to use?

EDIT :

I slected prefer JRE rather than preferJDK und JRE window, that was the problem there.

Julien
  • 19
  • 1
  • 6
  • did you tried https://www.excelsiorjet.com/? – Mohsen Dec 07 '18 at 10:14
  • To run Java you need JRE installed, it's simple as that. – steven35 Dec 07 '18 at 10:16
  • No I didn't, at least not to the end. I found this difficult. – Julien Dec 07 '18 at 11:22
  • *"No I didn't"* 1) Tip: Add @Spara (or whoever, the `@` is important) to *notify* the person of a new comment. 2) *"Is there nothing else more easy to use? .. I found this difficult."* Reliable / robust deployment of a desktop app. is a lot trickier than people often guess. – Andrew Thompson Dec 07 '18 at 12:03
  • 1
    @AndrewThompson thank you for that. Ok I didn't think so. Well if there is really not another way to do I'll try it. – Julien Dec 07 '18 at 14:28

1 Answers1

1

In Launch4j, under JRE > Bundled JRE path, type something like ./runtime. When you wrap your JAR file into an EXE, the EXE will look for a java runtime in the current directory under a subdirectory called "runtime". If you copy a Java runtime directory into the same directory as your wrapped EXE file, it will use it.

enter image description here

In Windows Explorer:

enter image description here

The "runtime" directory is the complete JRE directory, E.G. "jre1.8.0_201", but renamed. Inside there should be a bin folder and a lib folder and some other files.

Magnus Bull
  • 1,027
  • 1
  • 10
  • 21
  • Thank you for your answer @Magnus Bull. It sounds like a great idea but I solved my problem in an other way. In fact I slected prefer JRE rather than preferJDK under JRE window. Sorry, I didn't update my question ! – Julien Jan 30 '19 at 11:29