Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java version check in bin/jmeter script in 2.12 fails on Solaris 10 #3544

Closed
asfimport opened this issue Feb 19, 2015 · 4 comments
Closed

Java version check in bin/jmeter script in 2.12 fails on Solaris 10 #3544

asfimport opened this issue Feb 19, 2015 · 4 comments

Comments

@asfimport
Copy link
Collaborator

Michael Strasser (Bug 57608):
The Java version check code in bin/jmeter script in 2.12 fails when run on Solaris 10.

Example failure output:

-bash-3.2$ /opt/apache-jmeter-2.12/bin/jmeter
/opt/apache-jmeter-2.12/bin/jmeter: syntax error at line 32: `CURRENT_VERSION=$' unexpected

Line 32 contains:

CURRENT_VERSION=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')

This syntax is not accepted by the standard shell /bin/sh.

More about the system:

-bash-3.2$ uname -a
SunOS ssessdevbuild 5.10 Generic_147147-26 sun4v sparc sun4v

JMeter 2.11 does not have the Java version check and works on Solaris 10.

Severity: normal
OS: Solaris

@asfimport
Copy link
Collaborator Author

Rainer Jung (migrated from Bugzilla):
Could you please check, whether

CURRENT_VERSION="$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}'

works for you? It should be compatible with any shel.

Any other problems with the script?

Thanks,

Rainer

@asfimport
Copy link
Collaborator Author

Michael Strasser (migrated from Bugzilla):
Hi Rainer, thanks for your quick response.

Replacing $( ... ) with ... works in this Solaris shell.

There was also a problem with the awk command in the same line. The version of awk on Solaris 10 cannot have a space between the -F option and the field separator (gawk allows one).

Here is a diff between the original and the version that works on Solaris:

-bash-3.2$ diff jmeter.orig jmeter
32,34c32,34
< CURRENT_VERSION=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')
< minimal_version=$(echo $MINIMAL_VERSION | awk -F'.' '{ print $2 }')
< current_version=$(echo $CURRENT_VERSION | awk -F'.' '{ print $2 }')

CURRENT_VERSION="$_java" -version 2&gt;&1 | awk -F'"' '/version/ {print $2}'
minimal_version=echo $MINIMAL_VERSION | awk -F'.' '{ print $2 }'
current_version=echo $CURRENT_VERSION | awk -F'.' '{ print $2 }'
46c46
< case $(uname) in


case uname in

@asfimport
Copy link
Collaborator Author

Rainer Jung (migrated from Bugzilla):
I also fixed the $(uname) and applied the change to both, bin/jmeter.sh and bin/jmeter which in trunk both had the problematic lines. No other JMeter shell scripts seem to use the sub shell notation $(...).

@asfimport
Copy link
Collaborator Author

Rainer Jung (migrated from Bugzilla):
Date: Fri Feb 20 05:15:13 2015
New Revision: 1661060

URL: http://svn.apache.org/r1661060
Log:
#3544 - Java version check in bin/jmeter script
in 2.12 fails on Solaris 10

#3544

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant