Search code examples
javaparametersbatch-filetomcat6environment

How to pass the -D additional parameter while starting tomcat?


I have a maven project, after running command mvn install all project as well as module compile and copied to local repository successfully. But now I want to run the generated web application in tomcat6. Client provided some parameter for tomcat like -Dapp.username,-Dapp.username, which will be used internally once project will start.ButI do not know how to set these additional parameter in tomcat6. Below is my development environment

  1. OS = Windows
  2. Tomcat = tomcat 6.0.27

Please help me?


Solution

  • You can set an environment variable to do that. E.g. in Linux:

    export JAVA_OPTS="-Dapp.username -Dapp.username"

    Or in Windows:

    set JAVA_OPTS="-Dapp.username -Dapp.username"

    Do this before starting Tomcat