I am trying to execute a jar by using java -jar test.jar
. However, when I keep the jar name in a variable e.g
$a = "test.jar"
And try the execution using java -jar $a
, it gives me an error
ERROR: Unable to access jarfile test.jar
I am trying to execute a jar by using java -jar test.jar
. However, when I keep the jar name in a variable e.g
$a = "test.jar"
And try the execution using java -jar $a
, it gives me an error
ERROR: Unable to access jarfile test.jar
Error meassage is quite clear, java cannot access the file: check whether you're launching this command in correct directory (where the .jar is located) and your powershell process has permissions to access it.