Java CLI arguments are ignored when running the program when windows start

59 Views Asked by At

I created a Java program that I want to automatically run when I turn on my PC, so I made the following run.bat and put it in Window's Startup folder:

start javaw -jar "Program.jar" "some default arg"

When I double click it myself, everything works.
But after I restart my PC, I always get an ArrayIndexOutBoundsException for the line that accesses args[0].

Why is this happening?

0

There are 0 best solutions below