1

I created application by automator for running jmeter. Since 10.13, this application does not work any more.

My shell script(I put jmeter directory in application Contents):

RADIR=`ps x | grep jmeter | grep -v grep | cut -c 28- `
COMMAND="$(dirname "$RADIR")/jmeter/bin/jmeter > /dev/null 2>&1 &"
eval $COMMAND

I checked that command is correct. But it doesn't work by running application. And it worked well before 10.12

I got some messages in Console log, The reason seems to be security exception. I am not sure enter image description here

Some security mechanisms have been changed? How can fix it?

Thanks

2
  • RADIR will only be set is jmeter is already running, have you tried hardcoding the directory jmeter resides in in the COMMAND variable? For troubleshooting purposes you could remove the redirections to /dev/null (> /dev/null 2>&1) and see which messages are logged.
    – jaume
    Commented Jun 6, 2018 at 8:35
  • 1
    @jaume You give me an import idea. I change my COMMAND for redirecting output message to a log file. I got error detail. That's Java version problem. About my previous analysis, I was totally wrong. Thank you.
    – Gino
    Commented Jun 7, 2018 at 6:21

1 Answer 1

2

About my previous analysis, I was totally wrong.

I ignore an important thing, Java version, not mac os x version. I just installed jdk 10 additionally and I also have jdk 8 in my system. Of course I set environment variable JAVA_HOME for jdk 8 in .bash_profile and .bashrc files, I checked java version in Terminal, it's java 8, everything is fine.

But in automator running process, java version is 10

Change shell script for getting error message

RADIR=`ps x | grep jmeter | grep -v grep | cut -c 28- `
java -version > ~/log.jmeter 2>&1 &
COMMAND="$(dirname "$RADIR")/jmeter/bin/jmeter >> ~/log.jmeter 2>&1 &"
eval $COMMAND

log.jmeter:

java version "10.0.1" 2018-04-17

Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)

Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

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

What!!!! That's the problem~~~

Change shell script to fix it:

export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
export PATH=$PATH:$JAVA_HOME/bin
RADIR=`ps x | grep jmeter | grep -v grep | cut -c 28- `
COMMAND="$(dirname "$RADIR")/jmeter/bin/jmeter > /dev/null 2>&1 &"
eval $COMMAND

It works well.

So, there are two problems in this issue:

  1. Jmeter is not support jdk 10 (wait for official update)
  2. How to properly set java home environment variable for automator?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .