glassfish v3 版是直接解压即可使用的,在部署上可以说方便的很,不过一般服务器上有N多应用及N多JDK,默认的JDK的可能版本较低而导致glassfish v3启动失败,此时直接修改下glassfish asadmin 自身的默认JDK是比较合适的做法。
asadmin 为一个简单的shell脚本,查看发现可以设置AS_JAVA变量即可 :
#!/bin/sh
#
# Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Always use JDK 1.6 or higher
AS_INSTALL=`dirname “$0″`/../glassfish
AS_INSTALL_LIB=”$AS_INSTALL/modules”
. “${AS_INSTALL}/config/asenv.conf”
JAVA=java
#Depends upon Java from ../config/asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
JAVA=/usr/java/jdk1.6.0_17/bin/java
exec “$JAVA” -jar “$AS_INSTALL_LIB/admin-cli.jar” “$@”
#!/bin/sh
## Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.# Use is subject to license terms.## Always use JDK 1.6 or higherAS_INSTALL=`dirname “$0″`/../glassfishAS_INSTALL_LIB=”$AS_INSTALL/modules”. “${AS_INSTALL}/config/asenv.conf”JAVA=java#Depends upon Java from ../config/asenv.confif [ ${AS_JAVA} ]; then JAVA=${AS_JAVA}/bin/javafi
JAVA=/usr/java/jdk1.6.0_17/bin/java
exec “$JAVA” -jar “$AS_INSTALL_LIB/admin-cli.jar” “$@”
//以上示例为临时方便直接修改了 JAVA 变量 ,实际只需设置 AS_JAVA 即可
发表评论