如何安排在Windows中每天运行java程序? [英] How to schedule a java program to run daily in Windows?

查看:105
本文介绍了如何安排在Windows中每天运行java程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个Java程序,使用Google Analytic API检索到目前为止的Google数据并将其导出为CSV文件。我希望每天运行此程序,以便CSV文件中的数据是最新的。我怎样才能做到这一点?

I have written a Java program which retrieves Google data till present date using Google Analytic API and export it as CSV file. I want this program to run daily so that data in the CSV file will be up to date. How can I achieve this?

推荐答案

您可以使用Windows任务计划程序(参见教程)启动任何程序;对于Java,您可能希望创建一个批处理文件来运行Java程序,然后使用Scheduler来运行批处理文件。

You can use the Windows Task Scheduler (see tutorial) to start any program; for Java, you will probably want to create a batch file to run your Java program, then use the Scheduler to run the batch file.

您还可以使用可执行JAR

您可能需要指定起始目录 - 请参阅这个帖子

You may need to specify the start directory - see this thread.

这篇关于如何安排在Windows中每天运行java程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆