I would expect that a compiled JBoss and a application compiled with full Java5 compatibility will work as the JVM should be compatilbe an exec code compiled with previous versions.
Also application code compiled with Java7 but without using features of Java6/7 shuould work.
I would be conservative and use compiler with Java5 compatible flag for source check and compiled code.