[英]How can I Start My application on Start up of Windows in java
I have My Swing Application. 我有我的Swing应用程序。 and What I want to do is Lunch that Application when Windows Start up. 而我想做的是在Windows启动时午餐该应用程序。 so how can I do that Can i have suggestion? 那我怎么能这样做我可以提出建议吗? and application is Desktop application. 和应用程序是桌面应用程序 and What to do for MAC system is there any way for MAC system for do this same? 为MAC系统做什么有什么方法可以让MAC系统做到这一点?
Click the Start button Picture of the Start button , click All Programs, right-click the Startup folder, and then click Open. 单击“开始”按钮“开始”按钮的图片,单击“所有程序”,右键单击“启动”文件夹,然后单击“打开”。
Open the location that contains the item you want to create a shortcut to. 打开包含要为其创建快捷方式的项目的位置。
Right-click the item, and then click Create Shortcut. 右键单击该项,然后单击“创建快捷方式”。 The new shortcut appears in the same location as the original item. 新快捷方式显示在与原始项目相同的位置。
Drag the shortcut into the Startup folder. 将快捷方式拖到Startup文件夹中。
You could simply place an executable item in the users Startup folder, see Run a program automatically when Windows starts for more details. 您只需将可执行项放在用户的“启动”文件夹中,请参阅Windows启动时自动运行程序以获取更多详细信息。
This will require to supply a short-cut (which can launch the jar using java.exe) or a batch file or a executable wrapper, like exe4j or launch4j for example. 这将需要提供快捷方式(可以使用java.exe启动jar)或批处理文件或可执行包装器,例如exe4j或launch4j 。
There are a few places to look for startup items: 有几个地方可以查找启动项:
Items can launch upon startup from the following locations: 项目可以在以下位置启动时启动:
System Preferences > Accounts > yourusername > Login Items 系统偏好设置>帐户>您的用户名>登录项
(Lion users: System Preferences > Users & Groups > yourusername > Login Items) (Lion用户:系统偏好设置>用户和组>您的用户名>登录项目)
/Library/LaunchAgents/ and ~/Library/LaunchAgents/ / Library / LaunchAgents /和〜/ Library / LaunchAgents /
(Lion users: In Finder, click Go > Go to Folder > then enter the path) (Lion用户:在Finder中,单击Go> Go to Folder>然后输入路径)
/Library/StartupItems/ /库/ StartupItems /
(Lion users: In Finder, click Go > Go to Folder > then enter the path) (Lion用户:在Finder中,单击Go> Go to Folder>然后输入路径)
This assumes that the application has been bundled as an application bundle. 这假设应用程序已捆绑为应用程序包。 See Packaging a Java App for Distribution on a Mac and Java Application Bundler for more details. 有关详细信息,请参阅在Mac和Java Application Bundler 上打包Java App以进行分发 。
There may be additional requirements in the pinfo files that I've not highlighted, but these are the basics. pinfo文件中可能还有其他要求我没有突出显示,但这些是基础知识。 This is not an area I have experience in, but something I've done a little bit of research into 这不是我经历过的一个领域,但我已经做了一些研究
Take a look at: 看一眼:
For more details 更多细节
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.