sudo -i vi /etc/.bash_profile
JAVA_HOME=//Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home CLASSPATH=./$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar PATH=$JAVA_HOME/bin:$PATH: export JAVA_HOME export CLASSPATH export PATH
source /etc/.bash_profile
java -version
sudo -i vi /etc/.bash_profile
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home CLASSPATH=./$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar M2_HOME=/Volumes/1/installed/apache-maven-3.6.3 PATH=$JAVA_HOME/bin:$PATH:$M2_HOME/bin export JAVA_HOME export CLASSPATH export PATH export M2_HOME
source /etc/.bash_profile
mvn -v
配置apache-maven-3.6.0/conf/settings.xml
cd /Volumes/1/installed/apache-tomcat-9.0.30
sudo chmod 755 *.sh
sudo sh ./startup.sh
可以看到如下信息 Using CATALINA_BASE: /Volumes/1/installed/apache-tomcat-9.0.30 Using CATALINA_HOME: /Volumes/1/installed/apache-tomcat-9.0.30 Using CATALINA_TMPDIR: /Volumes/1/installed/apache-tomcat-9.0.30/temp Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home Using CLASSPATH: /Volumes/1/installed/apache-tomcat-9.0.30/bin/bootstrap.jar:/Volumes/1/installed/apache-tomcat-9.0.30/bin/tomcat-juli.jar Tomcat started.
到浏览器输入网址localhost
关闭Tomcat,用终端输入sh ./shutdown.sh,回车即可关闭
sudo为系统超级管理员权限. chmod 改变一个或多个文件的存取模式 755代表用户对该文件拥有读、写、执行的权限,同组的其他人员拥有执行和读的权限,没有写的权限,其它用户的权限和同组人员一样. 777代表,user,group ,others ,都有读写和可执行权限. chmod -R 777 folername,获取文件夹权限.
配置server(tomcat):window->preferences->servers>tomat
没有server:
1. 点击 【help】->【about eclipse IDE】获取版本号
2. 点击【help】->【Install New Software…】
3. 点击work with的下拉条,选择版本号
4. 选择 Web,XML, Java EE and OSGi Enterprise Development下JST Server AdaptersExtensions,进行勾选。然后点击下一步NEXT。
原文:https://www.cnblogs.com/haimishasha/p/12292661.html