Create setenv.sh to set system property

14,979

It looks like the problem you have is magic quotes, note that (U+201D : RIGHT DOUBLE QUOTATION MARK) is not the same as " (U+0022 : QUOTATION MARK), the former will cause your shell script to fail (this is a prblem you need to watch out for when copying from people's blogs) e.g.

setenv.sh: line 1: export: `-Danothervariable=value': not a valid identifier

setenv.sh: line 1: export: `-Danother.variable=value”': not a valid identifier

Try this which used "

export JAVA_OPTS="-Dmyprojectvar.subname=value -Danothervariable=value -Danother.variable=value"

I just noticed you have a space between = and " that shouldn't be there either.

Share:
14,979

Related videos on Youtube

user3475398
Author by

user3475398

Updated on September 18, 2022

Comments

  • user3475398
    user3475398 over 1 year

    I have to use setenv.sh to set system properties on Linux with Tomcat Server 6.

    As described here Linux Environment- setenv.sh, I have created a setenv.sh in tomcat/bin, and the only think I added is the

    export JAVA_OPTS =”-Dmyprojectvar.subname=value -Danothervariable=value -Danother.variable=value”
    

    I don't know, is this enough to set the properties. I just want to add three properties to tomcat as system property using setenv.sh. What should I do to complete it successfully? What are the steps for it?

    I saw this question setenv.sh is not working. No is answer given there and I don't understand the question. Do we need to set CATALINA_HOME and other properties somewhere in setenv.sh?.

  • user3475398
    user3475398 almost 10 years
    Still the problem exist Shows "/catalina.sh: 1: export: : bad variable name" when I am trying to run catalina.sh
  • user9517
    user9517 almost 10 years
    See my update, also see your manager about some much needed education in shell basics - you really need it.