I have created a Java Program and also created an Executable jar file and store it in the same folder. In this folder, I have other documents such as log4j.properties and a some a log file housekeep.log. My main.java is stored under the src folder. I also created a bat file, which is running fine when I fire it manually. However, when I am trying to run it on a task scheduler, I cannot read the housekeep.log and also the log4j.properties and it gave me an Access is deined error. java.io.FileNotFoundExecption:housekeep.log <Access is Deined>
. How can I fix this issue?
Here is my code for my bat file.
@echo off
java -Xms512M -Xmx512M -jar C:\Users\admin\workspace\housekeep\housekeep.jar -o true
PAUSE