Automatically running a Java application at OS startup

一世执手 提交于 2019-11-28 04:58:19

问题


I need some way of starting my Java application without forcing the user to run the application manually. I'm not entirely sure how I would do it, can anyone provide any assistance?


回答1:


Run it as a Windows Service. It's the way to go.

For various ways to run it as a service, check out the answers to the following questions:

  • Install java program as a windows service: Alternative to JavaService?
  • How to create a windows service from java app

You can also read this article.




回答2:


use registry editor to add path of .exe file to startup goto Run from start menu, type regedit.exe

then navigate to HKEY_CURRENT_USER / SOFTWARE / MICROSOFT / WINDOWS / CURRENT_VERSION / RUN

on the right side, create a new string value with

name = "anything" and value = java.exe -jar "complete path of the file"

press ok to save the registry entry, restart your pc to see effect



来源:https://stackoverflow.com/questions/18874414/automatically-running-a-java-application-at-os-startup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!