Skip to content

Commit

Permalink
Respect JAVACMD and update Drip docs to reality
Browse files Browse the repository at this point in the history
Fixes #9373
  • Loading branch information
simmel authored and andrewvc committed Apr 27, 2018
1 parent 24a2792 commit c53c888
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ hello world

[Drip](https://github.com/ninjudd/drip) is a tool that solves the slow JVM startup problem while developing Logstash. The drip script is intended to be a drop-in replacement for the java command. We recommend using drip during development, in particular for running tests. Using drip, the first invocation of a command will not be faster but the subsequent commands will be swift.

To tell logstash to use drip, either set the `USE_DRIP=1` environment variable or set `` JAVACMD=`which drip` ``.
To tell logstash to use drip, set the environment variable `` JAVACMD=`which drip` ``.

Example (but see the *Testing* section below before running rspec for the first time):

USE_DRIP=1 bin/rspec
JAVACMD=`which drip` bin/rspec

**Caveats**

Expand Down
14 changes: 8 additions & 6 deletions bin/logstash.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ parse_jvm_options() {

setup_java() {
# set the path to java into JAVACMD which will be picked up by JRuby to launch itself
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVACMD="$JAVA_HOME/bin/java"
else
set +e
JAVACMD=`command -v java`
set -e
if [ -z "$JAVACMD" ]; then
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVACMD="$JAVA_HOME/bin/java"
else
set +e
JAVACMD=`command -v java`
set -e
fi
fi

if [ ! -x "$JAVACMD" ]; then
Expand Down

0 comments on commit c53c888

Please sign in to comment.