centos下bash: XXX: command not found的解決方案

來源:互聯網
上載者:User

centos下bash: XXX: command not found的解決方案

最近想在centos下做Android項目構建,配置好jdk和Android sdk後,同時也在/etc/profile將java和Android的環境變數配置進去,但是卻無法像windows 下一樣,直接使用android update project命令。

出現情況如下:bash: android: command not found

此時,我們可以使用ln命令將android 添加到/usr/bin目錄下,詳細解決方案如下:

1.使用cd /usr/bin 進入到該目錄

2.使用ln -s -f android sdk安裝目錄/tools/android命令,將android連結到該目錄上。

3.完成。此時我們就可以在任意目錄使用android命令啦。

所以,如果出現bash: ant: command not found等情況,均可以使用此方法嘗試解決。

最後,附上linux ln命令的說明:ln是linux中又一個非常重要命令,它的功能是為某一個檔案在另外一個位置建立一個同步的連結。

文法:

1.將某個檔案連結到一個檔案上 ln [-f | -n] [-s] SourceFile [TargetFile]

2.將一個或者多個檔案連結到一個目錄上ln [-f | -n] [-s] SourceFile ... TargetDirectory

相關文章

聯繫我們

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