Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM 6.1 Downgrade of a Java version and quickstart shows UnsupportedClassVersionError major.minor version 52.0

Avatar

Not applicable

We were using AEM 6.1 quickstart on Windows machine with Java 1.8.

To be consistent with other teams, we had to downgrade our Java version to 1.7.0_79 , after we uninstalled Java 8 and rest the JAVA_HOME and PATH variable to reflect the new (downgraded) version of Java and ran AEM using "crx-quickstart.jar" file, AEM started properly but the default startup page does not load and shows this exception:

java.lang.UnsupportedClassVersionError: org/apache/jsp/libs/granite/core/components/login/login_jsp : Unsupported major.minor version 52.0 RequestURI=/libs/granite/core/content/login.html Servlet= /libs/granite/core/components/login/login.jsp ApacheSling/2.4 (jetty/9.2.9.v20150224, Java HotSpot(TM) 64-Bit Server VM 1.7.0_79, Windows 7 6.1 amd64) 

 

One of the solution that worked for us is to rename or delete the "crx-quickstart" folder.. and starting AEM, would work as AEM will recompile everything using the correct version of Java and everything works as expected. But is there any other way.. not to rename/delete the crx-quickstart folder?

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Surendra,

you need to force the recompilation of your jsp pages. 

In previous versions of AEM you could recompile by deleting the content of "/var/classes".

In AEM 6 the class files are stored on the filesystem and could be recompiled using http://localhost:4502/system/console/slingjsp, however this doesn't appear to be working in AEM 6.1

In which case you could try and delete the generated class files yourself. Please take a backup before deleting anything. Go to /system/console/bundles and look for the  org.apache.sling.commons.fsclassloader bundle and note the bundle number, for example if the bundle id is 218 from there to go to file system and find bundle218, e.g. "crx-quickstart/launchpad/felix/bundle218". You will find the class files in the "data/classes" folder under the bundle folder e.g "crx-quickstart/launchpad/felix/bundle218/data/classes". Delete the classes folder, and load the startup page again.

Regards,

Opkar

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

Hi Surendra,

you need to force the recompilation of your jsp pages. 

In previous versions of AEM you could recompile by deleting the content of "/var/classes".

In AEM 6 the class files are stored on the filesystem and could be recompiled using http://localhost:4502/system/console/slingjsp, however this doesn't appear to be working in AEM 6.1

In which case you could try and delete the generated class files yourself. Please take a backup before deleting anything. Go to /system/console/bundles and look for the  org.apache.sling.commons.fsclassloader bundle and note the bundle number, for example if the bundle id is 218 from there to go to file system and find bundle218, e.g. "crx-quickstart/launchpad/felix/bundle218". You will find the class files in the "data/classes" folder under the bundle folder e.g "crx-quickstart/launchpad/felix/bundle218/data/classes". Delete the classes folder, and load the startup page again.

Regards,

Opkar

Avatar

Administrator

Hi Surendra

Agreeing with Opkar Gill (force recompilation of JSP pages is needed), just to add something :

In AEM <= 6.0 the compiled classes are placed in CRX /var/classes - http://localhost:4502/crx/de/index.jsp#/var/classes. To force recompile any jsp files, deleting the node in /var/classeshelped; with AEM 61, the compiled class files are NOT placed in /var/classes any more, so to recompile jsps, use Felix Console - http://localhost:4502/system/console/slingjsp or to be 100% sure to the naked eye, follow these steps

             a. Stop bundle org.apache.sling.commons.fsclassloader
             b. Search with keyword classes in CQ install folder <author>\crx-quickstart\launchpad\felix
             c. Delete generated java/class files from <author>\crx-quickstart\launchpad\felix\<bundleXYZ>\data\classes
             d. Delete generated java files from /var/classes in CRX (sightly generated java files are placed here)
             e. Restart bundle org.apache.sling.commons.fsclassloader

I hope this will help you.

 

Thanks and Regards

Kautuk Sahni

Avatar

Not applicable

Thanks Opkar and Kautuk, the solution worked 🙂