A jdk and TOMCAT step-by-step installation shell script in linux just written today

Source: Internet
Author: User
The JDK and the shell script installed by TOMCAT in one step in a linux system are installed in the usrjava directory, and tomcat is installed in the usrlocal Directory. if the directory does not exist, it is automatically created, you only need to put the jdk and tomcat tar packages and scripts in the same directory, run the script to install JDK in the/usr/java directory of one-step installation of JDK and TOMCAT in a linux file, tomcat is installed in the/usr/local directory. if the directory does not exist, it is automatically created. you only need to put the tar package and script of jdk and tomcat in the same directory and execute the script. PS: This script can be executed repeatedly. repeated execution will automatically delete the jdk and tomcat directory that was last installed 01 #! /Bin/sh02 03if [-e/usr/java]; then04 echo "delete old exist jdk... "05 sleep 206 rm-rf/usr/java07 echo" install new jdk... "08 mkdir/usr/java09 sleep 210 tar zxvf jdk *-C/usr/java11else12 mkdir/usr/java13 tar zxvf jdk *-C/usr/java14fi15 16 JDKPATH = 'ls/ usr/java '17echo $ {JDKPATH} 18 19 echo ">/etc/profile20echo" # jdk env ">/etc/profile21echo" JAVA_HOME =/usr/java/$ {JDKPATH} ">>>/etc/profile22echo 'path = $ JAVA_HOME/bin: $ PATH '>/etc/profile23echo' CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar '>/etc/profile24echo 'export JAVA_HOME'>/etc/profile25echo 'export path'>/etc/profile26echo 'export classpath'>/etc/profile27 28if [-e/usr/local/apache-tomcat *]; then29 echo "delete old exist tomcat... "30 sleep 231 rm-rf/usr/local/apache-tomcat * 32 echo" install new tomcat... "33 sleep 234 tar zxvf apache-tomcat *-C/usr/local35else36 tar zxvf apache-tomcat *-C/usr/local37fi38 39cd/usr/local/apache-tomcat * 40 TOMCATPATH = 'pwd' 41echo $ {TOMCATPATH} 42 43 echo "">/etc/profile44echo "# tomcat env">/etc/profile45echo "TOMCAT_HOME =$ {TOMCATPATH}"> >/etc/profile46echo 'path = $ TOMCAT_HOME/bin: $ PATH '>/etc/profile: execute source/etc/profile to make the environment variable take effect.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.