Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions launchers/pipeline.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,45 +1,51 @@
#!/bin/bash
############################################
# Simple launch script for the command line
# version of the Daisy Pipeline
# version of the Daisy Pipeline
############################################

# This is the path to Java. Edit this variable to suite your needs.
JAVA=`which java 2> /dev/null`
#JAVA=/opt/jre1.5.0_04/bin/java




# Test java version
if [ -n "$JAVA" ]
then
JAVAVERSION=`$JAVA -version 2>&1 | grep version | cut -d '"' -f 2 | cut -d '.' -f 1-2`
JAVAMAJOR=`echo $JAVAVERSION | cut -d '.' -f 1`
JAVAMINOR=`echo $JAVAVERSION | cut -d '.' -f 2`
if [ $JAVAMAJOR -lt 1 -o $JAVAMINOR -lt 5 ]
then
# Get the full version string and extract major version
JAVA_VERSION_OUTPUT=`$JAVA -version 2>&1 | head -1`

# Handle both old format (1.x.y) and new format (x.y.z)
if echo "$JAVA_VERSION_OUTPUT" | grep -q '"1\.'
then
# Old format: "1.8.0_xxx" -> extract second number
JAVA_MAJOR_VERSION=`echo "$JAVA_VERSION_OUTPUT" | cut -d'"' -f2 | cut -d'.' -f2`
else
# New format: "11.0.x" or "17.0.x" or "25-ea" -> extract first number
JAVA_MAJOR_VERSION=`echo "$JAVA_VERSION_OUTPUT" | cut -d'"' -f2 | cut -d'.' -f1 | cut -d'-' -f1`
fi

echo "$JAVA_MAJOR_VERSION"
if [ "$JAVA_MAJOR_VERSION" -lt 8 ]
then
echo
echo "Error: This application requires Java 5 (or later) to run. Only"
echo " version $JAVAVERSION was found on your system path. Make sure"
echo " Java 5 (or later) is installed on the system and edit this"
echo " pipeline.sh script to insert the path to the 'java' command."
echo "Error: This application requires Java 8 (or later) to run. Only"
echo " version $JAVA_MAJOR_VERSION was found on your system path. Make sure"
echo " Java 8 (or later) is installed on the system and edit this"
echo " pipeline.sh script to insert the path to the 'java' command."
echo
echo " Current (incorrect) java path: $JAVA"
echo
exit 1
fi
else
echo
echo "Error: Java 5 was not found on your system path. Make sure Java 5"
echo "Error: Java 8 was not found on your system path. Make sure Java 8"
echo " (or later) is installed on the system and edit this"
echo " pipelins.sh script to insert the path to the 'java' command."
echo " pipeline.sh script to insert the path to the 'java' command."
echo
exit 1
fi



# Set classpath
if [[ "$(uname)" == 'Linux' ]]; then
# resolve the path to this script in the face of symlinks
Expand Down