Gen 8.6 Java Proxy build for Java 1.6 ("Unsupported major.minor version 52.0")
search cancel

Gen 8.6 Java Proxy build for Java 1.6 ("Unsupported major.minor version 52.0")


Article ID: 229336


Updated On:




Our app has proxies built in Gen 8.0, Gen 8.5 working fine ... having to redo all the proxies for Gen86 is a problem as our web app is on an older WebSphere (WAS) and a heap of Java there running 1.6 compatible libraries ... what options are there?

I read through this Community thread: Gen 8.6 Complete Release and Java Proxy Build which indicates that the runtimes for the build tool have all been upgraded to Java 1.8

Problem is, for backward compatibility with Java 1.6 , still want to build classic Java proxies in 1.6 - so the build tool no longer works as the j2ee version it wants is 1.8.
Received the error "org/apache/tools/ant/Main : Unsupported major.minor version 52.0":

java.lang.UnsupportedClassVersionError: org/apache/tools/ant/Main : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(

Could not find the main class:  Program will exit.


Release : 8.6

Component : CA Gen Build Tool


1. Up until 2 very recent PTFs for Gen BT & Java runtimes (October 2021), the Gen 8.6 Java runtimes, and any generated Java code were still compiled with Java 1.6 compatibility i.e. target="1.6" and source="1.6".
So to maintain the Java 1.6 compatibility DO NOT INSTALL these 2 PTFs for "Java8 source and target update to 1.8":

2. The Technical Requirements for Gen 8.6 Compilers require the use of either a Java 1.8 or Java 11 Compiler:
That requirement really relates to the Build Tool (BT) itself i.e. its compilation process and its runtimes.

3. Per #2, the BT build error is due to the compile picking up older version Java classes than 1.8.
CLASSPATH has "D:\APP\workspace\public\Sun\SDK\jdk\lib\tools.jar" at the end. That directory prefix "D:\APP\workspace\public\Sun\SDK\jdk" comes from the value of BT profile token LOC.JDK_HOME.
Per the Java 6 SE JDK test on the Community thread Gen 8.6 Complete Release and Java Proxy Build, the "org/apache/tools/ant/Main : Unsupported major.minor version 52.0" error is due to using an older JDK than 1.8, like 1.6.
It was confirmed that "D:\APP\workspace\public\Sun\SDK\jdk" is for an earlier JDK version than 1.8 and the problem was resolved after using a JDK 1.8 for LOC.JDK_HOME.