I'm trying to run my Send Email java app with Task Scheduler. I created jar file for my Main method. Then I used lunch4 to convert my jar file to exe. After that I created New Task in my Task Scheduler but my app does not run. In the box where is description for Last Run Result is message: The system cannot find the file specified. Can anyone help me with this error? Thanks in advance.
Asked
Active
Viewed 1,160 times
1 Answers
0
If your jar file does what you want, when you double click it. Creating basic task under Task Scheduler should do the trick for you. Just follow the wizard and point to your jar file in the Program/script selection.
Open Task Scheduler and on the Actions panel (on the right) Create Basic Task...
Hope that helps.

bigneo
- 141
- 10
-
I tried but that does not work for me. Can you please provide instructions for creating jar files from eclipse. Maybe I'm doing something wrong when I exporting my files. Thanks in advance. – espresso_coffee Jul 20 '15 at 17:57
-
11. Right click on project and go Export 2. Select Java > Runnable Jar file and click next 3. In the Launch Configuration section select program entry point e.g. class with main method 4. Select Export Destination and give it a name for the jar file 5. Depending on what libraries you use select library handling option (try different ones if selected doesn't work) I think this is it. Try double click jar to check if it works. – bigneo Jul 21 '15 at 08:08
-
If I click on my jar file icon, my app runs fine. If I create a new basic task in task scheduler my app does not run. In the field Last Run Result I have a message: (0x1). Do you know what is that and why my app still does not run with scheduler? – espresso_coffee Jul 21 '15 at 12:36
-
I'm not very familiar with windows scheduler, but I have heard that if you use IO operations in your program scheduler might not like that and extra parameters are needed. You could also try this topic if you haven't already. I think this guy gives detailed solution to your problem (In the second answer). http://stackoverflow.com/questions/15783553/run-a-jar-file-using-windows-scheduler – bigneo Jul 21 '15 at 12:53
-
Thanks for trying to help with this, I'm not familiar with Task Scheduler. – espresso_coffee Jul 21 '15 at 12:56
-
No problem, if you ever find solution, leave a comment so I know what was wrong. Lastly, you can try giving permissions to directories if using IO operations in you jar program. – bigneo Jul 21 '15 at 13:03