我想创建一个 Windows 服务来在我的系统上启动 RMI 服务。我用来在 cmd 上运行它的命令是
C:\Program Files\Java\jdk1.7.0_67\jre\bin\rmiregistry.exe -J-Djava.rmi.server.useCodebaseOnly=false 11100
我已经使用命令使用 windows sc.exe 创建了一个服务
sc.exe create registry_service binPath= "C:\Program Files\Java\jdk1.7.0_67\jre\bin\rmiregistry.exe -J-Djava.rmi.server.useCodebaseOnly=false 11100"
但是在启动此服务时,我收到一个弹出窗口,提示
"Error1053: service did not respond to start or control request in timely fashion."
谁能告诉我哪里错了?
最佳答案
您不能使用任何任意 .exe 作为 Windows 服务。有特殊要求。您需要使用 Windows Service Wrapper,您可以从 Microsoft 下载它。
关于java - 为 RMI 注册表创建 Windows 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27985027/