JAVA Version 1.7 is Not Supported by JIRA 5.1.x
JIRA installation or upgrades can fail with errors indicating mismatch in Java classes
The following may appear in the
Unable to enable plugin com.atlassian.sal.jira java.lang.ClassCastException
There are many other similar manifestations of the error in the log files. The above one is just one example.
Java Version 1.7 is not supported by JIRA 5.1.x and below. See Supported Platforms for more details.
Set the Java environment to an appropriate JRE as described in the Supported Platforms article.