'javadoc generation command variable substitution

I am trying to generate javadoc in a bash script

COPYRIGHT='xxxx © 2021, 2022, XXXXXX'
DOC_DIR='docs'
javadoc --frames --no-module-directories  -sourcepath ./ -d ./${DOC_DIR} -bottom ${COPYRIGHT} -header 'xxxxx' -subpackages test

I get error:

javadoc: error - Illegal package name: "©"

1 error 1 warning

However, I receive no error if i do the following:

    DOC_DIR='docs'
    javadoc --frames --no-module-directories  -sourcepath ./ -d ./${DOC_DIR} -bottom 'xxxx © 2021, 2022, XXXXXX' -header 'xxxxx' -subpackages test

How do I resolve this issue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source