mac下java 開發環境搭建

來源:互聯網
上載者:User

標籤:dmg   etc   儲存   停止   path   gui   oracle   .sh   錯誤   

mac配置java開發環境: jdk1.7 +sdk1.7+maven +tomcat 

 1、先安裝jdk ,才能安裝sdk 。2 mac中jdk1.7的預設位置:/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home 配置JAVA_HOME:使用者目錄下opne .bash_profile    如果沒有這個檔案可以自己建立一個 可以瞭解下mac下的設定檔./etc/profile 檔案   全域共有配置,無論哪個使用者登入,都會讀取此檔案/etc/bashrc    (一般在這個檔案中添加系統級環境變數)全域(公有)配置,bash shell執行時,不管是何種方式,都會讀取此檔案。~/.bash_profile  (一般在這個檔案中添加使用者級環境變數) 配置環境: 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 儲存退出即可。立即生效需要執行:$ source .bash_profile(這是檔案名稱) 配置Tomcat:進入使用者目錄,編輯.bash_profilecd ~/vim .bash_profile增加如下:export PATH=$PATH:/usr/local/apache-tomcat-8.0.9/bin - 設定startup.sh檔案的許可權chmod 755 /usr/local/apache-tomcat-8.0.9/bin/*.sh- 啟動tomcatsh startup.sh- 測試可以使用:http://localhost:8080- 停止tomcatsh shutdown.sh 添加系統管理使用者: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"/>
  安裝sdk錯誤:This program requires DISPLAY environment variable解決: vim ~/.bash_profile  添加 export DISPLAY=:0 即可 :1、下載mac版專用的jdk1.7,地址如下:https://jdk7.java.net/download.html jdk-7u60-ea-bin-b15-macosx-x86_64-16_apr_2014.dmg 2、下載sdk  index

mac下java 開發環境搭建

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.