Create setenv.sh to set system property
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.
Related videos on Youtube
user3475398
Updated on September 18, 2022Comments
-
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 insetenv.sh?
. -
user3475398 almost 10 yearsStill the problem exist Shows "/catalina.sh: 1: export: : bad variable name" when I am trying to run catalina.sh
-
user9517 almost 10 yearsSee my update, also see your manager about some much needed education in shell basics - you really need it.