In addition to the Force.com IDE, you can also use a script to deploy Apex.
Download the Force.com Migration Tool if you want to use a script for deploying Apex from a Developer Edition or sandbox organization to a Database.com production organization using Apache's Ant build tool.
Apache Ant version 1.7.0 compiled on December 13 2006
The ant deployCode calls the Ant target named deploy in the build.xml file.
<!-- Shows deploying code & running tests for package 'codepkg' -->
<target name="deployCode">
<!-- Upload the contents of the "codepkg" package, running the tests for just 1 class -->
<sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployroot="codepkg">
<runTest>SampleDeployClass</runTest>
</sf:deploy>
</target>For more information on deploy, see Understanding deploy.
ant undeployCode calls the Ant target named undeployCode in the build.xml file.
<target name="undeployCode"> <sf:deploy username="${sf.username}" password="${sf.password}" serverurl= "${sf.serverurl}" deployroot="removecodepkg"/> </target>