TOMCAT: How to set ENV-Variable

D

David Baer

Hello,

I'd like to pass my tomcat4-servlets a environment variable. In a "normal"
programm I am doing this with java -DMY_ENV=$MY_ENV ApplicationName.

How can I add the -D option to tomcat?

I have not found any ideas on the web. The only idea was to use catalina.sh,
a file which does not exist in our environment :(

any ideas or hints are welcome.

thanks!

dave
 
E

Erwin Moller

David said:
Hello,

I'd like to pass my tomcat4-servlets a environment variable. In a "normal"
programm I am doing this with java -DMY_ENV=$MY_ENV ApplicationName.

How can I add the -D option to tomcat?

I have not found any ideas on the web. The only idea was to use
catalina.sh, a file which does not exist in our environment :(

any ideas or hints are welcome.

thanks!

dave

Hi dave,

You don't have catalina.sh??
I have a hint: Just follow the script you use that starts tomcat.
I guess that will be startup.sh in the bin directory.

open that file and check it.
In mine it calls catalina.sh at the end.
(Maybe in your case something else)
And above that line I have an export statement.
in my case:
export CATALINA_OPTS="-Djava.awt.headless=true"

I think you can add extra option in there.

You can also (maybe better) follow the script that is called in your case
(catalina.sh in my case) and read that. You will find the possibility to
add extra option there, I expect.

Good luck!

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top