Bug 61667 - Bad detection of Java home in bin/jmeter
Summary: Bad detection of Java home in bin/jmeter
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: Nightly (Please specify date)
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-25 21:36 UTC by Antonio Gomes Rodrigues
Modified: 2017-11-04 18:07 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Gomes Rodrigues 2017-10-25 21:36:31 UTC
Hi,

In the line if $darwin; then

darwin variable is not defined in my Linux (Mageia)

When I run JMeter I have this error

ra77@localhost bin]$ ./jmeter
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program

To fix it, we need to initialize the darwin variable with uname or $OSTYPE

Check 
http://f00bar.com/blog/2011/07/09/simple-robust-os-detection-in-bash-using-ostype/

https://stackoverflow.com/questions/394230/detect-the-os-from-a-bash-script

Proposed fix

if $darwin; then

become

if [ "$(uname)" == "Darwin" ]; then

Antonio
Comment 1 Antonio Gomes Rodrigues 2017-10-27 16:27:45 UTC
Bug 61529 - Migration to Java 9
This closes #308
Bugzilla Id: 61529

Modified:
    jmeter/trunk/bin/jmeter
    jmeter/trunk/build.xml
    jmeter/trunk/src/components/org/apache/jmeter/control/ModuleController.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/ApplyNamingConvention.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeNode.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
    jmeter/trunk/xdocs/changes.xml
Comment 2 Antonio Gomes Rodrigues 2017-10-27 16:43:10 UTC
Previous comment are false

New Revision: 1813548

URL: http://svn.apache.org/viewvc?rev=1813548&view=rev
Log:
Bug 61667 - Bad detection of Java home in bin/jmeter

Modified:
    jmeter/trunk/bin/jmeter
Comment 3 Felix Schumacher 2017-11-04 18:07:08 UTC
Author: fschumacher
Date: Sat Nov  4 18:03:54 2017
New Revision: 1814311

URL: http://svn.apache.org/viewvc?rev=1814311&view=rev
Log:
Shell tests for equality use only one equals sign.

Followup to r1813548.
Bugzilla Id: 61667

Modified:
    jmeter/trunk/bin/jmeter
Comment 4 The ASF infrastructure team 2022-09-24 20:38:10 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4545