To undeploy cart.ear using NetBeans IDE:
Click the Services tab.
Expand the Servers node and locate the Application Server instance to which you deployed cart.
Expand your Application Server instance node, then Applications->Enterprise Applications.
Right-click cart and select Undeploy.
To undeploy cart.ear using Ant, enter the following command: