0

Theres a game jam coming up that I want to participate in. Java has been what I program games in, so its natural that I would want to use it in this game jam. Problem is, it cannot require other software. And I believe that includes Java. So is there some way to include java within some sort of exe file? Or otherwise include it? Assets dont have to be contained, but the overall size does have to be less than 1GB, so I need enough space for the actual game and assets.

2 Answers2

0

This was answered in this post.

Compiling a java program into an executable

You will need a wrapper for your .jar files.

Lanch4j is one viable option to do this.

Link to software: http://launch4j.sourceforge.net/

Here is a tutorial on how to use it: https://www.youtube.com/watch?v=MyMPPuYGN-U&ab_channel=GoXR3PlusStudio

Best of luck with your game jam.

  • As you mentioned, Launch4j is technically just a wrapper, and still requires a Java runtime to execute the executable. So to use this option without installing Java, you have to use the Launch4j option to bundle a JRE, which comes kind of close to "not installing Java". – Kevin Welker May 19 '22 at 14:31
0

If running on a Linux machine, a way to do this is by using a JVM that supports compiling the Java program to a native executable.

For example, GraalVM offers native-image compilation functionality.

Michail Alexakis
  • 1,405
  • 15
  • 14