ANT在Mac OS X上的安装和设置

ANT在Mac OS X上的安装和设置

1. 关于ANT installation on Mac OS X

 这是一篇国外的文章:

Installation of Ant on OS X



Recently at work, I had to perform the task of setting up Ant on my PowerBook, and I was not satisfied with the tutorials I found online. When I finished setting up everything, I wanted to record the entire procedure for my own sake and also for people who need it. At this point, if you don’t know what is Ant, you can probably stop reading further. Most likely you will not need the knowledge that I am about to share. Of course, if you already know how to do this, then please don’t waste your time.



Before I get into step-by-step instruction, you need to download Ant. and I am assuming you saved it on your desktop. Next, open you Terminal and type the following commands:



   1. cd ~/Desktop

   2. sudo sh

   3. mv apache-ant-1.6.5-bin.zip /usr/local/

   4. cd /usr/local/

   5. unzip apache-ant-1.6.5-bin.zip

   6. chown (your account name):(your account name) apache-ant-1.6.5

   7. ln -s apache-ant-1.6.5 ant



Now, let me explain what each line of command means:



   1. Navigate to the Desktop folder where you saved the zip file.

   2. Authenticate as root/superuser, you will need to type your password to complete the authentication.

   3. Move the Ant zip file to the directory /usr/local.

   4. Navigate to directory /usr/local. You can execute ls command to list the content of the current directory just to verify the zip file is here.

   5. Unzip the zip file (pretty obvious).

   6. Change the ownership of the expanded directory to your regular account, so in the future you can modify the Ant folder without authenticating as root again.

   7. Create a link or alias, this step is optional. After the creation of this link, you can refer to Ant directory as /usr/local/ant, instead of /usr/local/apache-ant-1.6.5.



To test whether everything was done correctly, you can open a new Terminal window, and type /usr/local/ant/bin/ant. You should be able to execute Ant if everything is correct. Last thing we need to do is to set up our account so we can simply type Ant instead of this long command. After all, we are all too lazy to type few more characters.



Assuming the default shell of your Terminal is bash; make sure the following lines are in the bashrc file. You can find the file under /etc.



   1. export ANT_HOME=/usr/local/ant

   2. export PATH=${PATH}:${ANT_HOME}/bin



That’s it. To test it, quit all your Terminal windows, and then re-open a new one, type ant, you should see an error message complaining that build.xml does not exist. Done! I hope this is helpful to someone.

from: http://www.asceticmonk.com/blog/?p=388 

2. ANT在Mac 上的安装位置:

在Mac OS X 10.5 (Leopard)中,ant是默认自带的工具.这样当你需要做一些扩展时就需要知道它被默认安装的地方:

/usr/shared/ant

将你要安装的*.jar文件放到/usr/share/ant/lib中即可.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Mac安装FinalShell,您可以按照以下步骤进行操作: 1. 打开终端(Terminal)应用程序。 2. 在终端中输入以下命令并按回车键执行: ``` curl -o finalshell_install.sh www.hostbuf.com/downloads/finalshell_install.sh;chmod +x finalshell_install.sh;sudo ./finalshell_install.sh ``` 这将下载FinalShell安装脚本并执行安装过程。\[1\] 3. 安装完成后,您可以在Mac上找到FinalShell的安装路径。\[1\] 请注意,这是一种安装FinalShell的方法,具体步骤可能会因版本或其他因素而有所不同。如果您遇到任何问题,请参考FinalShell的官方文档或联系他们的技术支持。 #### 引用[.reference_title] - *1* [FinalShell Mac OS安装](https://blog.csdn.net/Lonely_Ant/article/details/80594385)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [mac xshell替代品FinalShell安装教程](https://blog.csdn.net/wisebaiy/article/details/79595800)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [FinalShell:FinalShell的安装及使用(Mac & Windows)](https://blog.csdn.net/weixin_42161670/article/details/115105011)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值