How to start a Java Jar when windows starts?

倖福魔咒の 提交于 2019-12-02 11:06:06

问题


I read you can add a key to the registry, but there are permission problems on Windows Vista and 7. What's the safest & best way to start a Java program on System startup?


回答1:


You can setup a Java service wrapper to start a Java application on windows startup. http://www.google.com/search?q=java+service+wrapper




回答2:


I'd use the Task Scheduler, have it run:

java -jar file.jar

And set it to run on computer startup, and to run with the highest privileges.




回答3:


You wanna do this on code or manually ?

But is all about the Registry, why don't you check the Java Service Wrapper ?




回答4:


winsw works very nicely: http://kenai.com/projects/winsw

(requires .NET though)



来源:https://stackoverflow.com/questions/4564813/how-to-start-a-java-jar-when-windows-starts

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