I have been working with Oracle and PostgreSQL, and I can confirm that neither of them supports table aliases in the SET clause, nor do they allow direct UPDATE with JOIN. Which database are you using?
I recommend rewriting your UPDATE statement using a subquery, like this:
@Modifying
@Query("UPDATE ActivityEnvironmentRelation aer "
+ "SET aer.isDeleted = 1, aer.updatedBy = :updatedBy "
+ "WHERE aer.activity.id IN ("
+ " SELECT a.id FROM Activity a WHERE a.project.objectId = :projectId"
+ ")")
void deleteActivityEnvironments(@Param("projectId") Long projectId, @Param("updatedBy") User updatedBy);