GlassFish服务器批处理代码启动和关闭

 一、JAVA环境变量的设置

假设JDK安装的目录是C:\Program Files\Java\jdk1.6.0_25

1、设置JAVA_HOME的值为C:\Program Files\Java\jdk1.6.0_25

2、设置PATH的值为%JAVA_HOME%\bin

3、设置CLASSPATH的值为.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar

 

 二、启动Glassfish的步骤

glassfish-3.1.2.2为Glassfosh的服务器文件夹

1、先启动glassfish-3.1.2.2\javadb\bin\startNetworkServer.bat

2、然后glassfish-3.1.2.2\glassfish\bin\startserv.bat

经过以上两个步骤服务器就已经启动了。

 

关闭Glassfish服务器的步骤:

1、先关闭glassfish-3.1.2.2\glassfish\bin\stopserv.bat

2、然后关闭glassfish-3.1.2.2\javadb\bin\stopNetworkServer.bat

经过以上两个步骤服务器就已经关闭了。

 

启动Glassfish的批处理代码:

 GLASSFISH_HOME为GLASSFISH服务器的安装目录,在我的电脑->高级->环境变量里面设置,

如E:\Glassfish Service\glassfish-3.1.1

@echo start glassfis ....
@echo OS  %OS%
@echo JAVA %JAVA_HOME%
@echo GLASSFISH %GLASSFISH_HOME%
@echo  startNetworkServer...
@start /b  %GLASSFISH_HOME%\javadb\bin\startNetworkServer.bat 
@echo NetworkServer started
@echo start glassfish server.....
@call %GLASSFISH_HOME%\glassfish\bin\startserv.bat 
exit

关闭Glassfish的批处理代码:

@echo stop glassfis ...
@call %GLASSFISH_HOME%\glassfish\bin\stopserv.bat
@call %GLASSFISH_HOME%\javadb\bin\stopNetworkServer.bat
exit


你可能感兴趣的:(GlassFish服务器批处理代码启动和关闭)