Lets suppose that I have a folder named white space
that contains a class file called foo
.
On the command line, I can easily call the foo program by the following command on the
java -cp "white space/" foo
and it would work fine.
I want to set this entire command as a variable in Bash and call this variable rather than the whole command itself.
So, lets say I set the command into the following
bar='java -cp "white space/" foo'
I tried calling the command by doing $bar
, but I keep getting an error saying:
Error: Could not find or load main class space
How would you resolve this?