Mac上使用eclipse搭建web伺服器

來源:互聯網
上載者:User

標籤:

1. 安裝eclipse

 

2. 安裝eclipse需要的組件

 

3. 安裝Tomcat (參考:在mac系統安裝Apache Tomcat的詳細步驟)

執行指令碼:startup.sh,在 Mac終端輸入:sh startup.sh

Mac下tomcat啟動 Cannot find ./catalina.sh 的解決方案:

Cannot find ./catalina.sh
The file is absent or does not have execute permission

This file is needed to run this program

沒有給bin目錄下的檔案授權可執行許可權:

chmod +x bin/*.sh

若已經在bin目錄下了,就在Mac終端直接執行 chmod +x *.sh

Mac下出現Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program 的解決方案:

是因為系統沒有安裝java環境,只需要開啟命令列,輸入:java -version,系統將會引導你安裝java環境,你直接安裝就可以了。

 出現下面的提示說明Tomcat啟動成功:

SunMmdeiMac:bin qianjing$ sh startup.sh

Using CATALINA_BASE:   /usr/local/apache-tomcat-7.0.57

Using CATALINA_HOME:   /usr/local/apache-tomcat-7.0.57

Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.57/temp

Using JRE_HOME:        /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

Using CLASSPATH:       /usr/local/apache-tomcat-7.0.57/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.57/bin/tomcat-juli.jar

Tomcat started.

 開啟safari瀏覽器,然後輸入網址 http://localhost:8080

如果能正常開啟tomcat首頁,說明tomcat 配置啟動成功。

 

4. eclipse下配置tomcat(參考:http://jingyan.baidu.com/article/ca2d939dd90183eb6d31ce79.html)

 

 

Mac上使用eclipse搭建web伺服器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.