问题
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