During the retrieve step (trying to retrieve the code) while trying to deploy the code in the target environment I get the following error:

Retrieve warnings (1): [sf:retrieve] package.xml - Entity type 'ApexClass' is not available in this organization

In the package.xml, I have provided the ApexClass metadata type. Btw, I get this error in a certain org but dont get this in other orgs while trying to retrieve using the migration toolkit.

  • This was working 2 days back and noticing this error only recently. We use the ant migration toolkit along with our CI setup with Jenkins
    – Suhas
    Apr 21, 2015 at 3:47

2 Answers 2


This could be a profile issue. Make sure your user's Profile has the "Author Apex" permission.

  • This was my issue when trying to retrieve metadata from our prod org using the Force Migration Tool. Thanks!
    – Harmon
    Nov 8, 2016 at 18:34

Not all orgs can use ApexClass. You need at least enterprise edition to use Apex Code. If the target org should be capable of housing code, it could be a glitch. In that case, contact support. They can fix this error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .