Spaces in JAVA_OPTS in tomcat

how to pass property having spaces in JAVA_OPTS to tomcat ... for example

-Dmy.property = "How are you"

OS - Suse Linux

  • thank
+5
source share
3 answers

It seems to me that there is no way to use spaces in JAVA_OPTS, I have the same problem on OSX. You can add your property directly to other -D options in the catalina.sh file

0
source

I really figured this out with AWS Elasticbeanstalk, which allows you to have spaces in the environment properties that you can enter through the user interface.

, Elasticbeanstalk /usr/bin/tomcat 7 script, .

, :

script:

if [ "$1" = "start" ]; then
    ${JAVACMD} $JAVA_OPTS $CATALINA_OPTS \

script:

if [ "$1" = "start" ]; then
    eval "${JAVACMD} $JAVA_OPTS $CATALINA_OPTS \
    ...."

.. "eval" JVM .

, JAVA_OPTS .

0

try it

-Dmy.property="How\ are\ you"
-3
source

All Articles