Running a JAVA program as a scheduled task Running a JAVA program as a scheduled task windows windows

Running a JAVA program as a scheduled task


I Think that you could create a simple batch script that will launch your program in this way :

@echo offREM Eventually change directory to the program directory cd C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\REM run the program"C:\Program Files\Java\jdk1.7.0\bin\java.exe" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"

Copy it into the notepad and save as java_script.cmd and then schedule this script instead of the program directly.


I solved it after changing all fonts' references to "SansSerif"

I was using Jasper Reports inside Java to create a PDF file. It was working fine when I double click the batch file or Scheduler with Windows Server 2003 but not working with the Scheduler of 2008.

I tried many different things nothing worked so I though Could it be that Windows Server 2008 is blocking the access?.

Now is working perfect. So, if you are having problems check the references to anything you are using.


The scheduler will run under a different user unless you specify what user to run as. If it isn't running as your user then it won't be able to write to your directories.