如何将 Java 应用程序安装为服务
我编写了一个 Java 应用程序,用于将选定的文件转发到 ssh 服务器。我希望这个应用程序在每次 Windows 启动时自动运行。
我知道这个问题已经被问过多次,并且我已经遵循了这些线索。我尝试过 Java Service Wrapper(由于 dns 问题而无法再访问)、Apache Daemon 和 JSL。尽管我有时能够将应用程序安装为服务,但我从未能够让它在启动时正常运行,甚至无法从命令行手动启动它。
我的问题是是否有人知道如何完成这项工作的完整的第一步到最后一步教程。我遇到过一些事情,但它们要么假设您已经实现了一些他们没有解释如何实现的东西,要么依赖于我没有安装的应用程序。
谢谢
I have a Java Application written that forwards selected files to an ssh server. I want this application to be automatically run every time windows starts.
I am aware that this question has been asked multiple times, and I have followed those leads. I have tried Java Service Wrapper (which is no longer accessible because of a dns problem), Apache Daemon, and JSL. Though I have at times been able to get the application installed as a service, I have never been able to get it to run properly on boot, or even start it manually from the command line.
My question is whether anyone is aware of a full first step through final step tutorial of how to make this work. I have come across a few things, but they all either assume that you have implemented something that they do not explain how to implement, or rely on applications that I do not have installed.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 Java Service Wrapper 作为 Windows 或 Linux 服务安装:http://wrapper.tanukisoftware。 com/doc/english/download.jsp
~>为您的应用程序创建一个可运行的 JAR。
~>下载正确的服务包装器(它们与Windows和Linux不同)
〜>在wrapper.conf中配置服务
重要:正确设置wrapper.java.classpath(您的jar也必须在这里)
使用
org.tanukisoftware.wrapper.WrapperSimpleApp
设置wrapper.java.mainclass
使用主类的名称设置
wrapper.app.parameter.1
,例如:~>作为控制台测试服务(windows bat)
I use Java Service Wrapper to install as windows or linux service: http://wrapper.tanukisoftware.com/doc/english/download.jsp
~> create one runnable JAR to your app.
~> Download the proper service wrapper (they are diffrent to windows and linux)
~> Configure the service in wrapper.conf
Important: set
wrapper.java.classpath
correct (your jar must be here too)Set
wrapper.java.mainclass
withorg.tanukisoftware.wrapper.WrapperSimpleApp
Set
wrapper.app.parameter.1
with the name of your main class, for example:~> Test the service as console (windows bat)