making setenv 'stick'

Posted:
in Genius Bar edited January 2014
this is one for any unix gurus:



i'm remotely accessing my ibook via ssh and starting and stopping jakarta tomcat from the bin directory with ./startup.sh and ./shutdown.sh



when i start afresh each day, i ALWAYS get an error saying JAVA_HOME environment variable is not set.



i set it with setenv JAVA_HOME /Library/Java/Home which works with no problem



BUT, how do i make this variable 'stick' so i don't need to keep entering it each day?



thanks in advance.

Comments

  • Reply 1 of 4
    add the setenv info to startup.sh?
  • Reply 2 of 4
    i had to use export JAVA_HOME="/Blah/Blah" from within the scripts but it works.



    thanks!



    IIRC there's a way to do it so it's universal and not on a per script basis... oh well. i'm just glad to get it working
  • Reply 3 of 4
    [quote]Originally posted by lungaretta:

    <strong>i had to use export JAVA_HOME="/Blah/Blah" from within the scripts but it works.



    thanks!



    IIRC there's a way to do it so it's universal and not on a per script basis... oh well. i'm just glad to get it working </strong><hr></blockquote>



    As 1337_5L4Xx0R said.



    It should work for all scripts if you put [ export JAVA_HOME="/Blah/Blah" ] in startup.sh
  • Reply 4 of 4
    rraburrabu Posts: 264member
    If you are running tcsh or csh, then add the setenv command to your .cshrc file in your home directory.



    Other shells have their own ...rc files.



    If JAVA_HOME is only used by jakarta, then adding it to startup.sh and shutdown.sh might be best.
Sign In or Register to comment.