JBOSS 启动配置

本文来源于百度空间

 

我下载的JBOSS服务器启动不了,环境变量配了好久,尝试了各种方式,网上也都搜集了好多,,现将最实用简单的解决方法转载如下:

如果装了JDK,没有配系统环境变量的话,是启动不了的

不过,不配也行,可以直接在jboss/bin目录下的run.bat文件中加上如下一句话就行

set JAVA_HOME=jdk的安装目录(如:D:\Program Files\Java\jdk1.6.0_13)

这里的jdk1.6.0_13是我安装的JDK,我现在直接把它复制到jboss目录下,然后在run.bat中设置一下JAVA_HOME就OK了

具体的加在哪里,可以参考下面的

rem Find run.jar, or we can't continue

set RUNJAR=%JBOSS_HOME%\bin\run.jar
if exist "%RUNJAR%" goto FOUND_RUN_JAR
echo Could not locate %RUNJAR%. Please check that you are in the
echo bin directory when running this script .
goto END

:FOUND_RUN_JAR

set JAVA_HOME=jdk的安装目录(如:D:\Program Files\Java\jdk1.6.0_13)

if not "%JAVA_HOME%" == "" goto ADD_TOOLS

set JAVA=java

echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
goto SKIP_TOOLS

:ADD_TOOLS

set JAVA=%JAVA_HOME%\bin\java

 

如果要关闭jboss的话,同样也得在shutdown.bat中像上面那样加一句JAVA_HOME配置,如下

rem Find MAIN_JAR, or we can't continue

set MAIN_JAR=%DIRNAME%\%MAIN_JAR_NAME%
if exist "%MAIN_JAR%" goto FOUND_MAIN_JAR
echo Could not locate %MAIN_JAR%. Please check that you are in the
echo bin directory when running this script .
goto END

:FOUND_MAIN_JAR

set JAVA_HOME=jdk的安装目录(如:D:\Program Files\Java\jdk1.6.0_13)

if not "%JAVA_HOME%" == "" goto HAVE_JAVA_HOME

set JAVA=java

echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
goto SKIP_SET_JAVA_HOME

:HAVE_JAVA_HOME

然后保存.

直接双击shutdown.bat是不行的,

会发现有一段说明,告诉你,需要用使用参数才行.

A JMX client to shutdown (exit or halt) a remote JBoss server.

usage: shutdown [options] <operation>

options:
    -h, --help                Show this help message (default)
    -D<name>[=<value>]        Set a system property
    --                        Stop processing options
    -s, --server=<url>        Specify the JNDI URL of the remote server
    -n, --serverName=<url>    Specify the JMX name of the ServerImpl
    -a, --adapter=<name>      Specify JNDI name of the MBeanServerConnection to
use
    -u, --user=<name>         Specify the username for authentication
    -p, --password=<name>     Specify the password for authentication

operations:
    -S, --shutdown            Shutdown the server
    -e, --exit=<code>         Force the VM to exit with a status code
    -H, --halt=<code>         Force the VM to halt with a status code

从上面的可以看出要使用 -S参数来进行关闭

即shutdown.bat -S命令

那么可以在shutdown.bat所在目录再新建一个bat文件----stop.bat,内容如下:

shutdown.bat -S

注意S是大写的

然后双击stop.bat即可关闭jboss

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值