Run Java application at Windows startup

Create a .bat file and put this inside:

javaw -Xmx200m -jar C:\Path\to\jarfile\TheJar.jar

Then put the .bat file into the windows startup folder.

One more thing: There’s a difference between using java and javaw. While java is better when you are debugging an application, the application prints text or something like that, javaw is better when you don’t need that. Why? Because java runs java program using a console that shows all that application prints (println’s, exception stacktraces and so on) while javaw doesn’t run on console.

Leave a Comment