MAC Environment variables

Source: Internet
Author: User
Tags gz file administrator password apache tomcat

Tomcat

1. To the official Apache homepage, download the full tar.gz file package for MAC version. Unzip the copy to the/library directory and name Tomcat, and the other directories are available.

2, modify the directory permissions to the terminal input sudo chmod 755/library/tomcat/bin/*.sh 3, start Tomcat Press ENTER after the prompt for the password, please enter the administrator password. Then type and enter:
sudo sh startup.sh
The following prompt indicates that the installation and operation succeeded:

Password:

Using catalina_base:/library/apache-tomcat-8.0.23

Using Catalina_home:/library/apache-tomcat-8.0.23

Using Catalina_tmpdir:/library/apache-tomcat-8.0.23/temp

Using Jre_home:/library/java/javavirtualmachines/jdk1.8.0_45.jdk/contents/home

Using CLASSPATH:/library/apache-tomcat-8.0.23/bin/bootstrap.jar:/library/apache-tomcat-8.0.23/bin/ Tomcat-juli.jar

Tomcat started.

4. Open the browser and enter http://localhost:8080/
If you see Apache Tomcat after the carriage return, it means that Tomcat has been successfully run

5. Configuration TomcatStartup script:

Use the text editor to add the following code:

#!/bin/bash

Case $ in
Start
sh/library/tomcat/bin/startup.sh
;;
Stop
sh/library/tomcat/bin/shutdown.sh
;;
Restart
sh/library/tomcat/bin/shutdown.sh
sh/library/tomcat/bin/startup.sh
;;
*)
echo "Usage:start|stop|restart"
;;
Esac

Exit 0

Save the file as Tomcat, lowercase with no suffix. Give File Execution permissions:

chmod 777 Tomcat 777 system default maximum permissions (read and write: )

。 Place this file in the path contained in the terminal, such as/usr/bin, and then simply enter Tomcat start and Tomcat stop in the terminal to enable Tomcat.

The shortcut commands are as follows:

1) Tomcat start

2) Tomcat stop

3) Tomcat restart

Jdk

xxxdemacbook-pro:~ XXX $ which Java

/usr/bin/java

Go to command line

CD ~touch. Bash_profilevi. Bash_profile

PS: If there is no. bash_profile file in the home directory, create a new

Enter the contents of the JDK variable configuration:

Cd/library not CD Library to see Java files

Export java_home=/library/java/javavirtualmachines/jdk1.7.0_45.jdk/contents/home #jdk安装路径   Export Path= $JAVA _ Home/bin: $PATH export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Input: Wq save.

To update a configuration file:

source. bash_profile

MAC Environment variables

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.