MAC Configuration Java Development environment: jdk1.7 +sdk1.7+maven +tomcat
1. Install the JDK before installing the SDK. 2 default location for jdk1.7 in Mac:/library/java/javavirtualmachines/jdk1.7.0
_40. Jdk/contents/home configuration Java_home: Opne under the user directory. Bash_profile If you do not have this file, you can create a profile under your Mac./etc/profile file globally shared configuration, regardless of which user Log in, this file is read/ETC/BASHRC (typically add a system-level environment variable in this file) global (public) configuration, which is read by the bash shell, regardless of the way it is executed. ~/.bash_profile (typically add user-level environment variables in this file) Configure the environment: maven_home=/users/taoyutong/documents/apache-maven-3.0.5java_home=/ Library/java/javavirtualmachines/jdk1.7.0_40.jdk/contents/homepath= $MAVEN _home/bin: $PATHPAHT = $JAVA _home/bin:$ PAHT Export Maven_homeexport java_homeexport PATH save exit. Immediate effect requires execution: $ source. Bash_profile (This is the file name)
To configure Tomcat:Go to User directory, edit. BASH_PROFILECD ~/vim. Bash_profile added as follows: Export path= $PATH:/usr/local/apache-tomcat-8.0.9/bin- Set permissions for the startup.sh file chmod 755/usr/local/apache-tomcat-8.0.9/bin/*.sh-start tomcatsh startup.sh-test can be used: http://localhost : 8080-Stop tomcatsh shutdown.sh add Admin User: Vim/usr/local/apache-tomcat-7.0.55/conf/tomcat-users.xml<role rolename= " Admin-gui "/> <role rolename=" Admin-script "/> <role rolename=" Manager-gui "/> <role rolename=" Manager-script "/> <role rolename=" manager-jmx "/> <role rolename=" manager-status "/> <user username= "Admin" password= "admin" roles= "Manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/ >
Install SDK Error: This program requires DISPLAY environment variable solution: Vim ~/.bash_profile Add export display=:0 Can: 1, download dedicated Mac version of the jdk1.7, the address is as follows: Https://jdk7.java.net/download.html JDK-7U60-EA-BIN-B15-MACOSX-X86_64-16_APR_2014.DMG 2. Download the SDK index
Build a Java development environment under Mac