Setting java and returning version

I am currently trying to write a script and I am not that great at wording it with taking in user input, it will do the following:

ask " Have you stopped instances? "
if instances are stopped, then I want it to change to the default java to 64 bits, and print the current version of java.
Afterwards I want it to return the default back to 32 bits.

Basically I want it to remove the existing symlink and recreate a new link to point to the other java version and display the info.

 
#!/bin/ksh
# -*- Mode: Bash; tab-width: 2; indent-tabs-mode: nil -*- vim:sta:et:sw=2:ts=2:syntax=sh
 
read -p " Have you stop the instances? [yn]" answer
if [ $answer = y ] 
then 
read -p " Do you want to set Java default to 64 bits? [yn]" answer
  if [ $answer = y ]
then (setServerJava -b 64)
elif
read -p " Do you want to set Java default to 32 bits? [yn]" answer
  if [ $answer = y ]
then (setServerJava -b 32) 
else 
echo "You have not stopped instances yet, cannot set Java default."
fi
 
 if [ setServerjava -b 64 ]
then
JAVA_VERSION=`java -version 2>&1 |awk 'NR==1{ gsub(/"/,""); print $3 }'`
# export JAVA_VERSION
echo $JAVA_VERSION
 fi
fi

any and all help is GREATLY appreciated, thanx

Usually, it is sufficient to set the $PATH so that the desired JAVA is before competing paths. However, to set a symlink is just "ln -s source_path target_path". The source path, if relative, needs to relative to the target path dir. Removing a symbolic link is just "rm target_path".

Some versions of JAVA also have a server mode, as opposed to a client mode, where there is more exhaustive compilation in the server mode; the client mode is more restrained, optimized for quick startup.