如何将一个class文件封装成windows服务?急!

jybsky 2003-02-16 04:45:02
如何将一个程序的class文件封装成一个windows服务,在系统启动时自动运行。象windows服务那样!
...全文
145 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
iamqqmyheart 2003-02-16
  • 打赏
  • 举报
回复
mark!
jybsky 2003-02-16
  • 打赏
  • 举报
回复
打成可自运行的JAR包以后放在哪里啊?谢谢啦
flyycyu 2003-02-16
  • 打赏
  • 举报
回复
up
lcl101 2003-02-16
  • 打赏
  • 举报
回复
你可以把他打成可自运行的JAR包呀
myelan 2003-02-16
  • 打赏
  • 举报
回复
xue_sharp(著名的反派角色)
有一个程序是专门把java程序做成服务的。是一个exe文件,加不同的参数。
tomcat的bin下面的tomcat.exe就是这个文件。其实是javaservice.exe。

Tomcat is a JSP engine and was the primary reason that JavaService was created. It is a pure Java application that is ideally used as a service, but comes with no native ability to do so. The following example shows how JavaService can be used to run Tomcat 3.1 as an NT service. The ideas shown here apply to using JavaService with any Java application that needs to run as an NT service. {JDK_HOME} is the location of your JDK and {TOMCAT_HOME} is the location of your Tomcat installation.

Copy the JavaService.exe file into the{TOMCAT_HOME}\bin directory as tomcat.exe.
Start a command prompt and change to the directory {TOMCAT_HOME}\bin.
Run the following command:
tomcat.exe -install Tomcat
{JDK_HOME}\jre\bin\{hotspot|server|classic}\jvm.dll
-Djava.class.path={TOMCAT_HOME}\bin\bootstrap.jar;{TOMCAT_HOME}\bin\servlet.jar;{JDK_HOME}\lib\tools.jar
-Dcatalina.home={TOMCAT_HOME}
-start org.apache.catalina.startup.Bootstrap
-params start
-stop org.apache.catalina.startup.Bootstrap
-params stop
-out {TOMCAT_HOME}\logs\stdout.log
-err {TOMCAT_HOME}\logs\stderr.log


注:默认安装为服务是马上启动,并且是自动运行的。
前一阵正好做这个,所以知道的多点。

jybsky 2003-02-16
  • 打赏
  • 举报
回复
自启动的配置文件在哪里啊
mercury1231 2003-02-16
  • 打赏
  • 举报
回复
系统自动运行不难啊,只要把该程序写入自启动的配置文件里就可以了。
jybsky 2003-02-16
  • 打赏
  • 举报
回复
是做成windows系统服务那样的,不需要手动完成!
zxhong 2003-02-16
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/1054/1054313.xml?temp=.9975702
sunni 2003-02-16
  • 打赏
  • 举报
回复
写成bat 然后加入到启动里面 或者是autoexec.bat 呵呵 这样行不行

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧