I tried searching for an answer to this but nothing I've found has worked. I am trying to execute a java application from a batch file but can't get the application to pickup my input text file directory. I'll illustrate what I mean.
In my java application, I have the following:
String myFile = System.getProperty("myfile");
System.err.println(myFile);
And in my batch application that is running the program I have:
set -Dmyfile="C:\directory"
However, when I actually run the program, it seems that myfile
isn't being picked up as a system property because null
is printed as the value of myFile
.
Could anyone offer some help please?