It is not possible to directly delete an Apex class or trigger after it has been deployed to production. Here are the steps to delete apex class or trigger in Salesforce Production Org by using eclipse and Force.com IDE.
- Download and Install the Force.com IDE for Eclipse.
- Connect to the Salesforce Production org.
- Download the apex class/trigger.
- Open the meta.xml file of the Apex class/trigger.
- Change the status of the Apex class/trigger to Deleted.
- Save and deploy to server.
Note: Apex class status can only be changed to “Active” or “Deleted” and not “Inactive”.
The Eclipse IDE for Java Developers distribution is recommended for Force.com IDE (Eclipse download site). You can install the Force.com IDE into your existing Eclipse distribution or upgrade from a previous version.
Before installing the Force.com IDE, ensure that you have these items installed on your workstation.
A supported operating system:
- Windows 7, 8, or 10
- macOS 10.7, 10.8, 10.9, 10.10, or 10.11
- Ubuntu 12.04 LTS or 14.04 LTS
Java SE Development Kit (JDK), Runtime Environment 8, or later (Java download site).
Note: Be sure to download the full JDK—without it, the plug-in doesn’t load. On macOS, the full JDK is not the default JRE installation.
- Launch Eclipse and select Help | Install New Software.
- Click Add.
- In the Add Repository dialog, set the name to Force.com IDE and the location to https://developer.salesforce.com/media/force-ide/eclipse45. For Spring ’16 (Force.com IDE v36.0) and earlier Force.com IDE versions, use https://developer.salesforce.com/media/force-ide/eclipse42.
- Click OK.
- To install an older version of the plug-in (for example, if you don’t have Java 8), deselect Show only the latest versions of available software. Eclipse downloads the list of available plug-ins and displays them in the Available Software dialog.
- Select Force.com IDE.
- If you want to install the Apex Debugger or our tools for working with Lightning components, select Force.com Debugger or Force.com Lightning Support.
- Click Next.
- In the Install Details dialog, click Next.
- In the Review Licenses dialog, accept the terms and click Finish.
- If you chose to install support for Lightning components, Eclipse displays a warning dialog about installing software that contains unsigned content. We are bundling third-party plug-ins to support Lightning components. Salesforce doesn’t own these third-party plug-ins; hence, we don’t sign them. Click OK to proceed.
- Eclipse downloads and installs the Force.com IDE and the required dependencies. When the installation is complete, you are prompted to restart. Click Yes.
- When Eclipse restarts, select Window | Open Perspective | Other. Select Force.com and then click OK.
You are now ready to develop and customize Force.com applications in Eclipse!
Note: When you create a project, you are sometimes prompted for a new master password. This master password is a separate password of your choosing. It’s required by Eclipse secure storage but not associated with your Force.com IDE credentials.