in reply to CLASSPATH problem when using backticks

Another option is to see if you can pass the classpath setting in an environment variable:
$ENV{CLASSPATH} = ...; my $output = `java ...`; # no need to specify -classpath here

Replies are listed 'Best First'.
Re^2: CLASSPATH problem when using backticks
by maithree (Novice) on May 22, 2008 at 06:33 UTC
    Thanks all for responding. The error given by java was actually misleading. Though the error mentioned ClassNotFound, the actual issue was in one of the command line parameters which also had a space in it. When I put that in quotes, I got the expected behaviour.

      the actual issue was in one of the command line parameters which also had a space in it.

      We know. That's what all the solutions we provided addressed. Adding quotes is actually a rather poor solution. The solutions provided go beyond adding quotes and avoid the need for quoting and escaping completely. That's much safer and reliable.