Bug 54023 - Unable to start JMeter from a root directory and if the full path of JMeter installation contains one or more spaces
Unable to start JMeter from a root directory and if the full path of JMeter i...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.8
PC Mac OS X 10.4
: P4 trivial (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-10-17 20:27 UTC by Daniel Aquino
Modified: 2012-11-17 20:14 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Aquino 2012-10-17 20:27:12 UTC

    
Comment 1 Philippe Mouawad 2012-10-27 12:45:24 UTC
Are you getting a bug ?
On which platform ? and with what kind of folder names ?

Thank you
Comment 2 Daniel Aquino 2012-11-01 15:29:46 UTC
That's proper shell practice to quote all paths in case they contain spaces.

That particular issue above causes the script to fail if any directory it's under contains a space:

$ p='/a/b c/d/e'

$ dirname $p
dirname: extra operand `c/d/e'
Try `dirname --help' for more information.

$ dirname "$p"
/a/b c/d
Comment 3 Philippe Mouawad 2012-11-17 16:08:51 UTC
On which OS does it fail ?

I tested on Mac OS X it works.
I don't have Linux to test.
Comment 4 Daniel Aquino 2012-11-17 18:28:53 UTC
Did you try the example code I posted ?  Because then you would see..

The line should look like this:

"$(dirname -- "$0")/ApacheJMeter.jar"
Comment 5 Milamber 2012-11-17 20:09:24 UTC
Description of issue:
bin/jmeter should quote paths properly, like this: "`dirname "$0"`/ApacheJMeter.jar"
Comment 6 Milamber 2012-11-17 20:14:21 UTC
Thanks for report. Fixed.

The issue occur when you try to launch JMeter since another directory (not bin dir) and if jmeter script path have one or more spaces.

Example 
$ /tmp/directory\ with\ spaces/apache-jmeter-2.8/bin/jmeter
dirname: extra operand `with'
Try `dirname --help' for more information.
Unable to access jarfile /ApacheJMeter.jar


Fixed by adding a double couple of quotes :

java $ARGS $JVM_ARGS -jar "`dirname "$0"`/ApacheJMeter.jar" "$@"

===
URL: http://svn.apache.org/viewvc?rev=1410775&view=rev
Log:
Unable to start JMeter from a root directory and if the full path of JMeter installation contains one or more spaces
Bugzilla Id: 54023

Modified:
    jmeter/trunk/bin/jmeter
    jmeter/trunk/xdocs/changes.xml