Java Question Java 8

Johan Schoeman

Expert
Licensed User
Longtime User
I am trying to use Java Open JDK 8 so that I can use Simple Library Compiler but when I compile a B4A project (configure path is set to javac.exe in the bin folder of JDK 8) I get the following error. Please assist with a solution. Should I use a different version of Java 8? I have also tried the download from Oracle and it creates the same error.

B4X:
Could not load processor class file due to 'androidx/lifecycle/LifecycleProcessor has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0'.

This is the download that I am using:

openlogic-openjdk-8u432-b06-windows-x64
 

teddybear

Well-Known Member
Licensed User
What external libraries are included in the library you want to compile using Simple Library Compiler? it seems that there is a class compiled by JDK 17.
 

Johan Schoeman

Expert
Licensed User
Longtime User
What external libraries are included in the library you want to compile using Simple Library Compiler? it seems that there is a class compiled by JDK 17.
It is an old project from about 2016. It used to compile in B4A when pointing to Java 8 but now not unless I point to Java 14 or Java 19. I have only installed Java 8 today on a different laptop than what I used to have.
 

drgottjr

Expert
Licensed User
Longtime User
as @teddybear comments, something in your project was built with java 17 (https://javaalmanac.io/bytecode/versions/).
it's not going to run on a jre for java 8. jre's are backward(ly) compatible, not vice versa.

@Daestrum posted a workaround for using slc with java versions 11+. i've used it, but i couldn't find it just now
when using the forum search. btw, i thought you could use newer java versions with slc; it was the .xml file generated
that didn't come out right. i seem to recall it working otherwise.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…