如何让 Java 应用程序在 PC 启动时自动启动? [英] How to make a Java app automatically start when PC starts?

查看:36
本文介绍了如何让 Java 应用程序在 PC 启动时自动启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个日程安排应用,它会提醒用户一天中要做的事情,它每分钟检查一次时间是否到了,如果时间到了,它会打开一个警报窗口来提醒用户.尽管它是用 Java 编写的,但我针对此应用程序的目标用户是 Windows 用户.它需要在用户的PC一打开就运行,所以我的问题是:如何使Java应用程序在Windows系统中打开PC时自动启动?

I'm developing a scheduling app, it reminds user of things to do during a day, it checks every minute to see if time is up, and if it is it will open an alert window to remind the user. Although it's written in Java, I'm targeting Windows users for this app. It needs to run as soon as users' PCs are turned on, so my question is: How to make a Java app automatically start when a PC is turned on in a Windows system?

我知道我可以手动通过几个步骤将应用程序添加到启动应用程序列表,但不是每个用户都熟悉这些步骤,所以我想知道它是否可以通过我的 Java 程序来完成,如果可以有示例代码吗?

I know I can go through a few steps manually to add the app to start-up apps list, but not every user is familiar with the steps, so I wonder if it can do this through my Java program, and if so is there any sample code?

推荐答案

创建 .bat 文件

create a .bat file

@javaw -jar path/to/jar/Name.jar arguments

把它放到你的启动目录中

drop this in you startup directory

这篇关于如何让 Java 应用程序在 PC 启动时自动启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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