#!/bin/bash
echo "first parameter is jdk version |||||||| second parameter is tomcat version";
JAVA_JDKVER="jdk6/jdk1.6.0" JAVA_TOMCATVER="tomcat6/apache-tomcat-6.0.43"
if [[ $1 -eq 5 ]];then JAVA_JDKVER="jdk5/jdk1.5.0_22" elif [[ $1 -eq 6 ]];then JAVA_JDKVER="jdk6/jdk1.6.0" elif [[ $1 -eq 7 ]];then JAVA_JDKVER="jdk7/jdk1.7.0_51" elif [[ $1 -eq 8 ]];then JAVA_JDKVER="jdk8/jdk1.8.0_25" fi
if [[ $2 -eq 5 ]];then JAVA_TOMCATVER="tomcat5/apache-tomcat-5.5.25" elif [[ $2 -eq 6 ]];then JAVA_TOMCATVER="tomcat6/apache-tomcat-6.0.43" elif [[ $2 -eq 7 ]];then JAVA_TOMCATVER="tomcat7/apache-tomcat-7.0.8" elif [[ $2 -eq 8 ]];then JAVA_TOMCATVER="tomcat8/apache-tomcat-8.0.9" fi
#if [ $1 -eq 7 ]then
JAVA_JDKVER="jdk7/jdk1.7.0_51"
#fi #if [ $1 -eq 8 ]then
JAVA_JDKVER="jdk8/jdk1.8.0_25`"
#fi echo $JAVA_JDKVER; echo '>>>>>>>>'$JAVA_TOMCATVER;
JAVA_HOME="/opt/test/jdk/$JAVA_JDKVER" PATH=$JAVA_HOME/bin:$PATH JRE_HOME="$JAVA_HOME/jre" /opt/test/tomcat/$JAVA_TOMCATVER/bin/startup.sh $*