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

jmeter formula doesn't support Java 9 #19939

Closed
5 tasks done
romanlevin opened this issue Oct 27, 2017 · 12 comments
Closed
5 tasks done

jmeter formula doesn't support Java 9 #19939

romanlevin opened this issue Oct 27, 2017 · 12 comments
Labels
java Java use is a significant feature of the PR or issue upstream issue An upstream issue report is needed

Comments

@romanlevin
Copy link
Contributor

romanlevin commented Oct 27, 2017

  • Confirmed this is a problem with brew installing one, specific Homebrew/homebrew-core formula (not cask or tap) and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/caskroom/homebrew-cask/issues/new. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed all issues and retried your prior step?
  • Ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link? https://gist.github.com/d880b0aeb9d83be2f2a98540421a9434
  • If brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

After installing jmeter, it fails to start:

$ jmeter
Error: Java version is too low to run JMeter. Needs at least Java >= 1.8.0

This because of this bit of shell script in /usr/local/Cellar/jmeter/3.3/libexec/bin/jmeter:

# Minimal version to run JMeter
MINIMAL_VERSION=1.8.0

# Check if Java is present and the minimal version requirement
_java=`type java | awk '{ print $ NF }'`
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 }'`
if [ $current_version ]; then
        if [ $current_version -lt $minimal_version ]; then
                 echo "Error: Java version is too low to run JMeter. Needs at least Java >= ${MINIMAL_VERSION}." 
                 exit 1
        fi
    else
         echo "Not able to find Java executable or version. Please check your Java installation."
         exit 1
fi

which compares the 8 in 1.8.0 to the 0 in 9.0.1 (the java cask), thus deciding Java 9 is too old.

This is a known issue.

@ilovezfs
Copy link
Contributor

Please file an issue upstream.

@ilovezfs ilovezfs added the upstream issue An upstream issue report is needed label Oct 27, 2017
@ilovezfs ilovezfs added the java Java use is a significant feature of the PR or issue label Oct 27, 2017
@romanlevin
Copy link
Contributor Author

@ilovezfs
Copy link
Contributor

Thanks @romanlevin!

@romanlevin
Copy link
Contributor Author

@ilovezfs given that jmeter doesn't support Java 9 at the moment, and 9 is the default Cask version, maybe there should be a caveat mentioning that in this formula?

@ilovezfs
Copy link
Contributor

@romanlevin no it needs a wrapper script and depends_on :java => "1.8" just like everything else on the planet that Java 9 broke.

@romanlevin
Copy link
Contributor Author

Oh okay. Not really clued in to this transition so wasn't aware it was a much larger issue.

@ilovezfs
Copy link
Contributor

@romanlevin yeah it's a bit of a mess #19696

@ilovezfs
Copy link
Contributor

I've added this to the list in #20543.

@nemtech13
Copy link

I removed/commented out the lines below in jmeter.bat to by pass this check since it is looking at the '0' in version 9. It works for me.

if %current_minor% LSS %minimal_minor% (
@echo Error: Java version -- %JAVAVER% -- is too low to run JMeter. Needs a Java version greater than or equal to %MINIMAL_VERSION%
set ERRORLEVEL=3
goto pause
)

@MBakirci
Copy link

@nemtech13
Same in the jmeter.sh file on mac os. Just remove/comment the java version check section.

_java=`type java | awk '{ print $ NF }'`
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 }'`
if [ $current_version ]; then
        if [ $current_version -lt $minimal_version ]; then
                 echo "Error: Java version is too low to run JMeter. Needs at least Java >= ${MINIMAL_VERSION}." 
                 exit 1
        fi
    else
         echo "Not able to find Java executable or version. Please check your Java installation."
         exit 1
fi

@apjanke apjanke mentioned this issue Feb 12, 2018
4 tasks
@ilovezfs ilovezfs reopened this Feb 12, 2018
@ilovezfs
Copy link
Contributor

This is now fixed if you brew update and brew upgrade

@meerkatside
Copy link

For run jmeter 3.3 with Java 10 I used this temporal solution.

_java=type java | awk '{ print $ NF }'
CURRENT_VERSION="$_java" -version 2>&1 | awk -F'"' '/version/ {print $2}'
minimal_version=echo $MINIMAL_VERSION | awk -F'.' '{ print $1 }'
current_version=echo $CURRENT_VERSION | awk -F'.' '{ print $1 }'

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
java Java use is a significant feature of the PR or issue upstream issue An upstream issue report is needed
Projects
None yet
Development

No branches or pull requests

5 participants