jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1624723 - in /jmeter/trunk/bin: jmeter jmeter.sh
Date Sat, 13 Sep 2014 11:37:40 GMT
Author: sebb
Date: Sat Sep 13 11:37:40 2014
New Revision: 1624723

URL: http://svn.apache.org/r1624723
Log:
Synchronise fixes to Unix shell scrips

Modified:
    jmeter/trunk/bin/jmeter
    jmeter/trunk/bin/jmeter.sh

Modified: jmeter/trunk/bin/jmeter
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter?rev=1624723&r1=1624722&r2=1624723&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter (original)
+++ jmeter/trunk/bin/jmeter Sat Sep 13 11:37:40 2014
@@ -19,6 +19,9 @@
 ##   Environment variables:
 ##   JVM_ARGS - optional java args, e.g. -Dprop=val
 ##
+##   e.g.
+##   JVM_ARGS="-Xms512m -Xmx512m" jmeter etc.
+##
 ##   ==============================================
 
 # Minimal version to run JMeter
@@ -39,6 +42,31 @@ if [ $current_version ]; then
          exit 1
 fi
 
+JMETER_OPTS=""
+case $(uname) in
+   Darwin*)
+   # Add Mac-specific property - should be ignored elsewhere (Bug 47064)
+   JMETER_OPTS="-Xdock:name=JMeter -Xdock:icon="`dirname $0`/../docs/images/logo.jpg" -Dapple.laf.useScreenMenuBar=true
-Dapple.eawt.quitStrategy=CLOSE_ALL_WINDOWS"
+   ;;
+esac
+
+
+# resolve links - $0 may be a softlink (code as used by Tomcat)
+# N.B. readlink would be a lot simpler but is not supported on Solaris
+PRG="$0"
+
+while [ -h "$PRG" ]; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+
+PRGDIR=`dirname "$PRG"`
+
 # The following should be reasonably good values for most tests running
 # on Sun JVMs. Following is the analysis on which it is based. If it's total
 # gibberish to you, please study my article at
@@ -105,4 +133,4 @@ SERVER="-server"
 
 ARGS="$SERVER $DUMP $HEAP $NEW $SURVIVOR $TENURING $EVACUATION $PERM $CLASS_UNLOAD"
 
-java $ARGS $JVM_ARGS -jar "`dirname "$0"`/ApacheJMeter.jar" "$@"
+java $ARGS $JVM_ARGS $JMETER_OPTS -jar "$PRGDIR/ApacheJMeter.jar" "$@"

Modified: jmeter/trunk/bin/jmeter.sh
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.sh?rev=1624723&r1=1624722&r2=1624723&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.sh (original)
+++ jmeter/trunk/bin/jmeter.sh Sat Sep 13 11:37:40 2014
@@ -27,6 +27,24 @@
 ##
 ##   ==============================================
 
+# Minimal version to run JMeter
+MINIMAL_VERSION=1.6.0
+
+# Check if Java is present and the minimal version requierement
+_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
+
 JMETER_OPTS=""
 case $(uname) in
    Darwin*)



Mime
View raw message