Multiline JAVA_OPTS in setenv.sh

前端 未结 3 1937
[愿得一人]
[愿得一人] 2020-12-28 08:47

I\'m trying to setup my setenv.sh on Ubuntu 12/Tomcat 7. Tomcat has been installed with apt-get I\'ve tried to create a multiline JAVA_OPTS variabl

相关标签:
3条回答
  • 2020-12-28 09:14

    You'd be better off with:

    JAVA_OPTS="$JAVA_OPTS -server "
    JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx512m"
    export JAVA_OPTS
    
    0 讨论(0)
  • 2020-12-28 09:17

    Wound up using something similar to Marc, but with escapes for spaces in property definitions

    export JAVA_OPTS="$JAVA_OPTS \
    -DFOO=\"bar bar\" \
    -DBAZ=\"bar2 bar2\" "
    
    0 讨论(0)
  • 2020-12-28 09:21

    Hmm, deleted the whole file and recreated it, and now it works..... Now using this style

    export JAVA_OPTS="$JAVA_OPTS\
     -server\
     -Xms704m\
     -Xmx704m\
     -XX:OnOutOfMemoryError=/usr/share/scripts/on_server_crash.sh\
     -XX:+HeapDumpOnOutOfMemoryError\
     -XX:HeapDumpPath=/var/log/tomcat7\
     -XX:MaxPermSize=128m\
     -XX:MaxNewSize=256m\
     -XX:NewSize=256m\
     -XX:SurvivorRatio=12\
     -XX:MaxTenuringThreshold=0\
     -XX:+UseConcMarkSweepGC\
     -XX:+CMSIncrementalMode\
     -XX:+CMSIncrementalPacing\
     -XX:+CMSClassUnloadingEnabled\
     -XX:+CMSPermGenSweepingEnabled\
     -XX:+DisableExplicitGC\
     -XX:+UseParNewGC\
     -XX:+UseTLAB\
     -Djava.awt.headless=true\
     -javaagent:$NR_JAR\
     -Dnewrelic. environment=production"
    
    0 讨论(0)
提交回复
热议问题