I am writing a script that installs java on a remote machine. After I run the .bin file for the JRE, how can I install alternatives to --config java, without having to enter anything.
For example, when you enter "alternatives --config java", you are prompted to choose which version of java you need. Due to the way I installed java ("/ usr / sbin / alternatives --install / usr / bin / java java / location / of / jdk1.6 / bin / java 2"), parameter # "2" should always be the java i want to choose.
So, using the ssh command, how can I choose the second option for java alternatives without the need for the user to select. I want it to be fully automated.
This is in a bash script.
thanks
Below is the code (now it works correctly):
#install the jre sshRetValue=`ssh -p "22" -i $HOME/sshids/idrsa-1.old ${1} " /home/geiser/jms_adapter/jre-6u25-linux-i586.bin "`; sshRetValue=`echo $?`; if [ "$sshRetValue" -eq 0 ];then echo "java jre installed successfully";
source share