Search code examples
javaauthenticationtomcattomcat8

How to set Java run time arguments in Tomcat 8


I have to set Java run time parameters for kerberos authentication. While running the stand alone executable jar the below argument was passed.

java -Djava.security.auth.login.config=./kconfig/conf/jaas.conf <exe jar>

How to set this in tomcat 8 ?


Solution

  • You could add following line(for linux) into /tomcat/bin/setenv.sh.

    JAVA_OPTS="$JAVA_OPTS -Djava.security.auth.login.config={path to}/jaas.conf"
    

    for windows add into \catalina-home\bin\catalina.bat

    set JAVA_OPTS=%JAVA_OPTS% -Djava.security.auth.login.config={path to}/jaas.conf"