Are you sure that JBoss EAP 5.1.0 works with JDK7?
If you need JBoss (EAP) 5.1 you should download 5.1.2 or 5.2 from the portal, this versions can be started with JDK7.
If you need more information you might use the Red Hat support as Paul mentioned.
Starting from EAP 5.1.2, Java 7 is supported. However, for EAP 5.1.2 you need to install a patch which you can obtain here:
As stated in the patch description it is advisable to upgrade to EAP 5.2 rather than to apply this patch.