Escape dollar sign in command line arguments
问题 When I pass in "$1000" through the command line and retrieve the string through args[0], it becomes "000". How can I maintain the full string in my java code? 回答1: I guess you're using some kind of Unix system, as '$' is the variable symbol in bash & co. Try using single quotes (e.g. java MyClass '$1000' ) 来源: https://stackoverflow.com/questions/33353649/escape-dollar-sign-in-command-line-arguments