shell - .Sh script to install java at a specific location -
i using following command install java 8 in ubuntu 32 bit matchine.i using .sh file run these commands-
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-set-default read -t 10
it's working fine facing 2 problems
it set default location in environment variable of java(i want install in specific direcory home/abc/ , set enviornment variable according that)
i want pause script 10 seconds @ end check console.
i want check either enviornment variable set or not using comamnd in .sh file
export path=$path:$(pwd)/linux_32/software/jdk1.8.0_20/bin
and when open terminal , check
java -version
it not show me why check there problem java installation. each time .sh terminal closed
it appears trying run java -version
after script modified path environment variable not persist beyond script. they're running in different shells. validate, run printenv path
, you'll notice jdk path not appended.
you try running java -version
within script or add jdk path
after script runs, e.g. in .profile
or .bashrc
.
Comments
Post a Comment