Monday, July 09, 2012

Adding ( passing) linux system variable to Tomcat.

Sometimes you need to pass system variables to applications running in tomcat environment. those could b for example configuration files.
Trying to pass them to start-up script as variables such as 

export TOMCAT_OPTS=-Your.var=foo
will set it in the system shell and will not pass it to the tomcat on it`s start since it runs as a different user.
Java`s System.getEnv("Your.var")
Will return: NULL value.
You need to edit relevant tomcat.conf (tomcat6.conf for example in /etc)
and add:
export Your.var=foo
to the end of file
You can check that variable s set with System.getEnv("Your.var") in you java code.



Provided by: ForthScale systems, scalable infrastructure experts

6 comments:

prathap kumar said...

Java Training in Chennai | Core Java Training in Chennai

Online Java Training | Java EE Training Institute in Chennai

geethu said...

To learn shorter programs when compared to Java then it is the right time to choose python training. There is increasing market demand for professionals who have completed python training.
python training in chennai | python training institutes in chennai

Devi.Angularjs said...

JMS Training Institutes in Chennai | JSP Training Institutes in Chennai | Java Spring Hibernate Training Institutes in Chennai | EJB Training Institutes in Chennai | Hibernate Training Institutes in Chennai |

JSF Training Institutes in Chennai | Java EE Training Institutes in Chennai | J2EE Training Institutes in Chennai | Core Java Training Institutes in Chennai | Java Training Institutes

Devi.Angularjs said...

JavaScript Training in Chennai | Ecmascript 6 Training in Chennai | ES6 Training in Chennai | Angular 2 Training in Chennai | HTML5 Training in Chennai

Yeoman Training | D3 Training | ReactJS Training | Gulp Training | CommonJS Training

Arthur Mac said...

This data is great and amazing. A debt of gratitude is in order for taking an ideal opportunity to talk about this, I feel upbeat about it and I adore adapting more about this theme. I utilize your manual for teach my understudies.
Regards,
Hibernate Training in Chennai | Hibernate course in Chennai | Spring and Hibernate Training in Chennai

Priya Kannan said...

This information really worth saying, i think you are master of the content and thank you so much sharing that valuable information and get new skills after refer that post.
Python Training in Chennai