你还是必须用VC写一个服务的shell, 然后再这个shell中调用java虚拟机。tomcat就是这么做的。
解决方案 »
- 今天偶然发现一个request的问题
- 运行一个桌面的程序出现的异常,大家帮忙看看有没有好的解决方案
- 初次运行java小程序,编译通过,但是运行时出现NoSuchMethodError错误,哪位老兄帮忙给调试一下?
- 高分求救!utf-8转gbk编码,奇数个中文字符出现乱码(偶数不会)!!!
- java应用程序如何写?
- http接口调用问题
- 用urlconnection实现“网络爬虫”功能时候,怎么解决登陆问题
- java的问题...热心的人来看看
- 请问在一个JLabel控件中能换行输出吗?我在其中输入"\n"的时候往往被忽略掉了!:(
- 将22222222.55显示为2,222,222.55,怎么处理
- 欢迎大家来讨论一下这个结构……
- 谁有jai,恳求发给我一份,感激涕零!!!!!!
把你的java程序嵌入RMI server端的impl中,这样它就可以像服务一样随时被
调用,然后你可以把rmiregistry 和运行rmi server都做成bat, 放在windows的启动里就可以了。我以前做过类似的事情。
tomcat的bin下面的tomcat.exe就是这个文件。其实是javaservice.exe。
给你个tomcat的例子,如果想要全部文档的程序给我发的信,我给你发过去。
[email protected] 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
太感谢各位兄弟!特别是xue_sharp(你是自愿被我泡的) !
我给你发了邮件,希望你能顺利收到,呵呵.这是和一个朋友在一起讨论的时候碰到的问题,现在有了答案,不深感激!