# Setting up env. variables at startup for all users (incl. root)



## alexkywalker (Sep 4, 2002)

*How do I setup environment variables at startup with GLOBAL visibility* 

I am new to Macs and Mac OS X. I am running the following services on my Mac:
- Tomcat 
- Jakarta Cactus
- JUnit
- Jakarta Ant

Every time I have to work with these I have to setup a JAVA_HOME and a CLASSPATH environment variables, using "setenv".

I already found how to automate this when a user (non-root) logs in, but I need these variables to be visible GLOBALLY.

Do you know how can I do this?

Thanks in advance.

Alejandro


----------



## btoneill (Sep 4, 2002)

You want to make the following files:
/etc/csh.login - this file should set the variables you want for csh and tcsh shells
/etc/profile - this file should set the variables for Bourne based shells (sh,ksh,bash)

This are run by the shell on login.

Brian


----------



## dani++ (Sep 5, 2002)

Take a look at:

/usr/share/init/tcsh/README


as well.


dani++


----------



## alexkywalker (Sep 7, 2002)

*It's working!*

After several unsuccessful attempts, I desperately searched the web and found this useful link that saved my life:

*How to Install Tomcat in Mac OS X*  

Thanks for your help!


----------



## mntamago (Sep 10, 2002)

> _Originally posted by alexkywalker _
> *It's working!
> 
> After several unsuccessful attempts, I desperately searched the web and found this useful link that saved my life:
> ...



One quick question...what OS are you running.  10.2 with the developer tools that come with it?


----------



## alexkywalker (Sep 10, 2002)

Nope, I am using 10.1.5

Why the question? Are there any implications in the configuration that could be affecting me?


----------



## mntamago (Sep 10, 2002)

> _Originally posted by alexkywalker _
> *Nope, I am using 10.1.5
> 
> Why the question? Are there any implications in the configuration that could be affecting me? *



No, No. No implications and such.  It is rather a personal issue.

What I mean is that I have been working with tomcat on my Mac OSX for a short while now.  I was just starting to get up to running speed -i.e. I had just got all the applications I wanted to utilize in my development set up and running smoothly together - when 10.2 came out.  And although I worried slightly about what might happen, when 10.2 arrived at my doorstep, I promptly installed it.

Since that time tomcat has not worked.  Thus, after reading you post I thought that perhaps I had found a glimmer of light in what otherwise is a rather dark tunnel at present.

BTW perhaps you have already seen this page, but the page I used to setup tomcat is:

http://developer.apple.com/internet/java/tomcat1.html

Thanks for the info!

m(_ _)m


----------

