|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
Java的桌面程序开发在java程序员里通常叫swing开发,主要用的swing包里的类开发的,也就是通常说的c/s架构开发window因为习气间接解紧缩,然后拷贝全部tomcat到服务器上,因而必要手工把tomcat安装成windows服务;
使用以下剧本便可完成:
rem
remNTServiceInstall/Uninstallscript
rem
remOptions
reminstallInstalltheserviceusingTomcat5asservicename.
remServiceisinstalledusingdefaultsettings.
remremoveCRemovetheservicefromtheSystem.
rem
remname(optional)Ifthesecondargumentispresentitisconsidered
remtobenewservicename
rem
rem$Id:service.bat,v1.52004/04/0816:49:37mturkExp$
rem-―――――――――――――――――――――――――C
remGuessCATALINA_HOMEifnotdefined
setCURRENT_DIR=%cd%
ifnot"%CATALINA_HOME%"==""gotogotHome
setCATALINA_HOME=%cd%
ifexist"%CATALINA_HOME%in omcat5.exe"gotookHome
remCDtotheupperdir
cd..
setCATALINA_HOME=%cd%
:gotHome
ifexist"%CATALINA_HOME%in omcat5.exe"gotookHome
echoThetomcat.exewasnotfound…
echoTheCATALINA_HOMEenvironmentvariableisnotdefinedcorrectly.
echoThisenvironmentvariableisneededtorunthisprogram
gotoend
:okHome
ifnot"%CATALINA_BASE%"==""gotogotBase
setCATALINA_BASE=%CATALINA_HOME%
:gotBase
setEXECUTABLE=%CATALINA_HOME%in omcat5.exe
remSetdefaultServicename
setSERVICE_NAME=Tomcat5
if"%1"==""gotodisplayUsage
if"%2"==""gotosetServiceName
setSERVICE_NAME=%2
:setServiceName
if%1==installgotodoInstall
if%1==removegotodoRemove
echoUnknownparameter"%1"
:displayUsage
echo
echoUsage:service.batinstall/remove[service_name]
gotoend
:doRemove
remRemovetheservice
"%EXECUTABLE%"//DS//%SERVICE_NAME%
echoTheservice%SERVICE_NAME%hasbeenremoved
gotoend
:doInstall
remInstalltheservice
remUsetheenvironmentvariablesasanexaple
remEachcommandlineoptionisprefixedwithPR_
setPR_DISPLAYNAME=ApacheTomcat
setPR_DESCRIPTION=ApacheTomcatServerChttp://jakarta.apache.org/tomcat
setPR_INSTALL=%EXECUTABLE%
setPR_LOGPATH=%CATALINA_HOME%logs
setPR_CLASSPATH=%CATALINA_HOME%inootstrap.jar
"%EXECUTABLE%"//IS//%SERVICE_NAME%--Jvm%JAVA_HOME%jreinserverjvm.dll--StartClassorg.apache.catalina.startup.Bootstrap--StopClassorg.apache.catalina.startup.Bootstrap--StartParamsstart--StopParamsstop--StopModejvm--StartModejvm
remCleartheenvironmentvariables.Theyarenotneededanymore.
setPR_DISPLAYNAME=
setPR_DESCRIPTION=
setPR_INSTALL=
setPR_LOGPATH=
setPR_CLASSPATH=
remMoreextraparameters
setPR_STDOUTPUT=%CATALINA_HOME%logsstdout.log
setPR_STDERROR=%CATALINA_HOME%logsstderr.log
"%EXECUTABLE%"//US//%SERVICE_NAME%--JvmOptions"-Djava.io.tmpdir=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_BASE%;-Djava.endorsed.dirs=%CATALINA_BASE%commonendorsed;"
echoTheservice%SERVICE_NAME%hasbeeninstalled
:end
cd%CURRENT_DIR%
在5.0.*测试经由过程
JAVA学习必须明确这是一项投资,对于大多数的人来说,学习JAVA是为了就业,还有就是刚走向工作位置的朋友想尽快赶上工作的节奏。 |
|