Update the JDK used by WebLogic

Yesterday I had to build my .ear with jdk8. After that, I tried to deploy it to my WebLogic.
It fails due to unsupported major.minor version.
[wldeploy] weblogic.application.ModuleException: java.lang.UnsupportedClassVersionError: xx/xx/xxx/xx/xx/xxx : Unsupported major.minor version 52.0

Here 52.0 meant jdk8. That is because while I created my domain, it was using jdk7 however my .ear was built by jdk8.

As a workaround, I commented out the ‘set JAVA_HOME=XX’ in MW_HOME/user_projects/domains/your_domain/bin/setDomainEnv.cmd and gave it a new one, e.g,

set JAVA_HOME=C:\jdk1.8.0_31

It worked.