view scripts/setjava.sh @ 340:5b1ab7484ad7

testing
author marc_davis <davis@ssdt-ohio.org>
date Tue, 30 May 2023 13:30:44 -0400
parents 7a17678c9a73
children
line wrap: on
line source
#!/bin/bash

if [ "${1}" == "7" ]
then
  export JAVA_HOME=$JAVA7
else
  export JAVA_HOME=$JAVA8
fi

IFS=':'
CYGWIN=nodosfilewarning
PATHNEW=''
for A in ${PATH}
do

  if [[ "$A" != *"Java"* || "$A" != *"jdk"* || "$A" == *"java"* ]] 
  then
    PATHNEW=$PATHNEW:"$A"
  fi
 
done
export PATH=$JAVA_HOME/bin$PATHNEW

# Output
echo -e "JAVA_HOME\t" $JAVA_HOME
echo -e "PATH"
for A in ${PATH}
do
  echo "${A}"
done