1

I have a project where I want to use Java v 1.7, so I made the change in my project for Java Compiler enter image description here and maven compiler as
enter image description here

But still When I deploy my JBoss application via IntelliJ I see error like

13:04:24,295 WARN  [org.jboss.modules] (MSC service thread 1-3) Failed to define class com.myorg.bb.business.LoginManager in Module "deployment.web-1.0-SNAPSHOT.war:main" from Service Module Loader: java.lang.UnsupportedClassVersionError: com/myorg/bb/business/LoginManager : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method) [classes.jar:1.6.0_29]
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [classes.jar:1.6.0_29]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [classes.jar:1.6.0_29]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [classes.jar:1.6.0_29]

How can I make this work with Java v1.7?

daydreamer
  • 87,243
  • 191
  • 450
  • 722
  • Do you have a Java 7 JDK installed? – Matt Ball Jan 22 '13 at 21:17
  • Yes, I do have it installed – daydreamer Jan 22 '13 at 21:22
  • JBoss may be still running under JDK 1.6 as its launcher script gets the JDK from `JAVA_HOME` environment variable. Make sure your system environment is correct and JBoss is started under JDK 1.7. You may need to adjust the startup script manually as tweaking environment on Mac OS X is tricky. – CrazyCoder Jan 23 '13 at 07:53

1 Answers1

4

Make sure JAVA_HOME is set to 1.7, you may try to override it in the JBoss Run/Debug configuration in IntelliJ IDEA as setting environment on Mac is tricky and depends on the OS version.

Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904