如何在Linux中设置CLASSPATH让grails找到外部配置? [英] How to set CLASSPATH in Linux to let grails find external configuration?

查看:161
本文介绍了如何在Linux中设置CLASSPATH让grails找到外部配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在linux下。我试图创建一个文件作为setenv.sh申报道路。



喜欢这个..

 export CLASSPATH = $ CLASSPATH:/ tampung / 


#启动时检查应用程序特定的参数
if [-r$ CATALINA_BASE /bin/appenv.sh];然后
。 $ CATALINA_BASE / bin / appenv.sh
fi

echoUsing CATALINA_OPTS:
for $ CATALINA_OPTS
do
echo> gt ;>$ arg
完成
echo

echo使用JAVA_OPTS:
用于$ JAVA_OPTS
中的arg
echo>>$ arg
done
echo_______________________________________________
echo

我想我使用这个文件可以重定向classpath位置

$ p $ grails.config.locations = [classpath:external-config.groovy] //我的意思是这个类路径

我该如何设置这个类路径?

解决方案

你只需要添加一个 CLASSPATH setenv.sh文件。
例如...像这样..

$ $ p $ CLASSPATH = / root / yourtomcatName / lib:/ yourexternalconfigpath
export CLASSPATH

然后重新运行您的tomcat。



希望它能帮助你。


under linux . i am trying to create a file as setenv.sh for declare a path..

like this..

export CLASSPATH=$CLASSPATH:/tampung/


# Check for application specific parameters at startup
if [ -r "$CATALINA_BASE/bin/appenv.sh" ]; then
  . "$CATALINA_BASE/bin/appenv.sh"
fi

echo "Using CATALINA_OPTS:"
for arg in $CATALINA_OPTS
do
    echo ">> " $arg
done
echo ""

echo "Using JAVA_OPTS:"
for arg in $JAVA_OPTS
do
    echo ">> " $arg
done
echo "_______________________________________________"
echo ""

i think i use this file can redirect "classpath" location

grails.config.locations = ["classpath:external-config.groovy"] //i mean this classpath

how can i set this classpath?

解决方案

you just need to add a CLASSPATH to your setenv.sh file. for example...like this..

CLASSPATH=/root/yourtomcatName/lib:/yourexternalconfigpath
export CLASSPATH 

then re run your tomcat.

hope it will help you.

这篇关于如何在Linux中设置CLASSPATH让grails找到外部配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆