Programming thread

Can someone help explain to me like I retarded how do I put a Java project on Steam? I tried to look it up, apparently I need to use launch4j to bundle it with Java? I have tried I can't make heads or tails of it . This is way more of a headache than I was expecting and I feel like a moron (:_(

I am using Netbeans. It is a Java project with Maven. I click Clean and Build main project. It makes the .jar file at projectfilder\target\theproject.jar I want to put that .jar file as an .exe for Windows on Steam. Apparently I need to use some third party tool Launch4J to do this. I can not understand how to use Launch4J to do what I want.
 
Last edited:
Can someone help explain to me like I retarded how do I put a Java project on Steam? I tried to look it up, apparently I need to use launch4j to bundle it with Java? I have tried I can't make heads or tails of it and I can't even run the .jar file anymore I get A Java Exception has occured. This is way more of a headache than I was expecting and I feel like a moron (:_(

I am using Netbeans. It is a Java project with Maven. I click Clean and Build main project. It makes the .jar file at projectfilder\target\theproject.jar I want to put that .jar file as an .exe for Windows on Steam.
In order to publish a Java program, you need to bundle a Java Runtime Environment, JRE. The JRE runs your Java program. If you'd like an example to copy, Project Zomboid is an example; it has a jre/ folder. I do not know the Netbeans path to achieving this.

If you cannot run the .JAR yourself, you're in a bad way. Step 1 is learning how to run the JAR. Step 2 is bundling what you need so other people can run the JAR.

I used to do this kind of JRE bundling/rebundling with some frequency at my old workplace. Steam, I presume, is just about pointing Steam at the right executables.

DeepSeek thinks jpackage (officialish) or Packr (community) are packages to help achieve this, but I know neither.
 
OK I uninstalled JRE8 and and reinstalled JDK25 and can now run the .Jar
Now I need to understand how to bundle the .JAR with JRE(?)
Do you mean making an executible .jar with a main file?

You can't bundle JRE with the Jar to make an .exe file or something like that, and your jar should already have its JDK version in its manifest.
 
The point is to use Launch4J to convert a .jar into a .exe with a local JRE so the person downloading it doesn't need java installed
I think I've got it now will take a while for KYC on steam before I can check
Odd I was unaware such a system existed. Why exactly are you using Java if your final intent was to bypass the portability of the JVM and run it on x86(Sometimes rarely ARM)? There are many more performative languages and platforms which more easily integrate into windows.
 
Odd I was unaware such a system existed. Why exactly are you using Java if your final intent was to bypass the portability of the JVM and run it on x86(Sometimes rarely ARM)? There are many more performative languages and platforms which more easily integrate into windows.
Probably for the sake of developing in something he knows well and using a framework like LibGDX.
 
Odd I was unaware such a system existed. Why exactly are you using Java if your final intent was to bypass the portability of the JVM and run it on x86(Sometimes rarely ARM)? There are many more performative languages and platforms which more easily integrate into windows.
No good reason I've simply only ever used Java I am still a noob
 
The point is to use Launch4J to convert a .jar into a .exe with a local JRE so the person downloading it doesn't need java installed
I think I've got it now will take a while for KYC on steam before I can check
Your issue intrigues me, isn't there a way to get Steam itself to install the latest JRE or required JRE package on the user's system so you don't have to bundle the whole thing with the game?
I imagine that's how it handles things like MSVC redist dependencies? I know as a user it just installs the required MSVC redist versions if I'm missing them, but how do they handle it exactly?
Good question, and yes — there's a real mechanism behind this. Steam's "auto-install runtime redistributables" behavior comes from Steamworks' installscript.vdf system, not anything magical.
How the MSVC redist thing works
When you package a build in Steamworks (via SteamPipe), you can attach an installscript.vdf to a depot/branch. This script runs during install/update on the client machine and can execute arbitrary setup binaries — most commonly:
Code:
"InstallScript"
{
    "Run Process"
    {
        "vcredist"
        {
            "process 1"
            {
                "process"    "vcredist_x64.exe"
                "command"    "/q"
                "no cleanup" ""
            }
        }
    }
}
You literally bundle the actual vcredist_x64.exe / vcredist_x86.exe (or the DirectX web installer, PhysX installer, etc.) as files in your depot, and the installscript tells Steam to run them silently with version-check flags so it doesn't reinstall every update. This is why you'll sometimes see "Installing Visual C++ Redistributable..." flash by in the Steam client during a game install — it's just running an EXE you shipped, gated by Steam's install pipeline.
So it's not Steam "knowing" your dependencies in any metadata sense — you are shipping the installer and Steam is just the delivery mechanism plus a hook to execute it at install-time.

Is there a Java equivalent?
Not really, no. There's no Steamworks-native "JRE dependency" concept. Games shipping on Steam that are Java-based (Minecraft being the famous edge case, though it predates/ignores this problem in its own weird way) generally do one of:
  1. Bundle a full JRE inside the depot, and launch via a wrapper/native launcher (or a shell script/batch file) that points at the bundled java.exe explicitly rather than relying on system PATH. This is by far the most common approach — tools like jpackage (built into modern JDKs) or Launch4j are used to produce a native-looking executable that bundles a minimal JRE image (often trimmed via jlink).
  2. Use the installscript.vdf mechanism to silently run a JRE installer, same trick as vcredist — technically possible, just uncommon because bundling is simpler and avoids polluting/depending on system Java state.
Bundling wins because you don't want your game's behavior to depend on whatever random JRE version (or vendor — Oracle vs Temurin vs Corretto) happens to be on the user's system, or whether they have Java installed at all.

What about .NET?
Depends heavily on which .NET and how you built it:
  • .NET Framework (legacy, pre-.NET-5): This ships with Windows or via Windows Update in most modern cases, but older/specific versions (3.5, 4.x) sometimes aren't present. Same installscript.vdf trick applies — bundle the redist installer and run it silently on install, exactly like vcredist.
  • .NET (Core) 5/6/7/8+, modern .NET: You have the option to publish as:
    • Framework-dependent — small deploy, but requires the correct shared runtime on the user's machine. If missing, you'd need the installscript trick to run the runtime installer.
    • Self-contained deployment (SCD) — bundles the entire runtime into your output folder, no dependency on what's installed system-side. This is the overwhelmingly preferred choice for Steam games for the same reason as Java: predictability. You can also combine this with single-file publish and trimming to cut down the bundle size somewhat.
Seems for Java and modern .NET it is preferable to bundle the runtime requirements to prevent version mismatch issues from making your game not run properly. You would have to update your runtimes if there are any security critical issues that are discovered in the runtimes.
 
Back
Top Bottom