Domanda

I'm having an issue with a custom hook I'm deploying in Liferay.

I've created both a hook and a theme using Liferay Plugins SDK 6.2.0

I create a .war (with Eclipse's built in Liferay -> SDK -> war command) for my theme, and deploy it onto my server running Liferay EE 6.2, which works fine.

However, I repeat the same process with my hook and I get this error:

at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsupportedClassVersionError: com/bofa/UserLoginImpl : 
Unsupported major.minor version 51.0 (unable to load class com.bofa.UserLoginImpl)
  at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassL
oader.java:2908)

I'm not sure if this could be a Java Compiler version error like I've read about, because my theme uses the same exact settings and works properly.

Any ideas?

È stato utile?

Soluzione

Its because of different JDK at compile time and runtime, make sure you are using same JDK version to compile and run it.

It generally occurs if a higher JDK version is used to compile the java file and a lower JDK version is used at runtime

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top