简体   繁体   English

如何在java中启动Windows启动我的应用程序

[英]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系统做到这一点?

  1. Click the Start button Picture of the Start button , click All Programs, right-click the Startup folder, and then click Open. 单击“开始”按钮“开始”按钮的图片,单击“所有程序”,右键单击“启动”文件夹,然后单击“打开”。

  2. Open the location that contains the item you want to create a shortcut to. 打开包含要为其创建快捷方式的项目的位置。

  3. Right-click the item, and then click Create Shortcut. 右键单击该项,然后单击“创建快捷方式”。 The new shortcut appears in the same location as the original item. 新快捷方式显示在与原始项目相同的位置。

  4. Drag the shortcut into the Startup folder. 将快捷方式拖到Startup文件夹中。

On Windows 在Windows上

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)或批处理文件或可执行包装器,例如exe4jlaunch4j

On Mac 在Mac上

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. 有关详细信息,请参阅在MacJava 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.

相关问题 如何在应用程序启动时禁用Java EE拦截器,例如根据数据库logger = info的条件? - How can I disable Java EE interceptor on application start up, for example by condition from database logger=info? 如何在Linux,Mac和Windows上从Java启动.NET应用程序? - How can I start a .NET application from Java on Linux, Mac and Windows? 如何使用procrun将Java应用程序作为Windows服务启动? - How to start a java application as a windows service with procrun? 如何在MainActivity(或应用程序)的开头隐藏片段? - How can I hide a fragment on start of my MainActivity( or the application)? 如何在没有错误的情况下启动Android SQLite应用程序 - How I can start my Android SQLite Application without a Error 我怎么能用另一种外观和感觉启动一个java应用程序(jar)? - how can i start a java application (jar) with another look & feel? 如何使用Java 11启动JavaFX应用程序? - How can I start a JavaFX application with Java 11? 如何通过Java应用程序启动/停止无线路由器? - How can I start/stop a Wireless Router through a Java Application? 如何像Netbeans起始页一样为Java应用程序创建起始页? - How could I create a start page for my Java application much like Netbeans start page? Windows 8开始屏幕上的Java应用程序 - java application on Windows 8 start screen
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM