Removed `which` dependency, now using proper shell builtin. 49/7549/1
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 30 May 2014 18:54:23 +0000 (14:54 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 30 May 2014 18:54:23 +0000 (14:54 -0400)
- `which` isn't installed by default on all distros.
- `which` doesn't resolve exactly like the shell, potential bugs.
- `which` unnecessary spawns a new process.

Change-Id: Ie89ea78b6f4cfb9c5415e889ec0393924870d883
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
opendaylight/distribution/opendaylight/src/main/resources/run.sh

index dba996a99425036ed0044514380726513671b47b..1e903d06503c286d7a0e8b41556c826eb5d6d105 100755 (executable)
@@ -13,7 +13,7 @@ if [[ $platform == 'linux' ]]; then
 
    if [[ -z ${JAVA_HOME} ]]; then
       # Find the actual location of the Java launcher:
-      java_launcher=`which java`
+      java_launcher=`command -v java`
       java_launcher=`readlink -f "${java_launcher}"`
 
       # Compute the Java home from the location of the Java launcher: