B4J Question Source option 7 is no longer supported (using JDK20)

Roycefer

Well-Known Member
Licensed User
Longtime User
Using Oracle's JDK 20, I get a B4J compile-time error saying
Compiler error:
Compiling generated Java code. Error
error: Source option 7 is no longer supported. Use 8 or later.

javac 20

The oft-suggested workarounds like "use an earlier JDK" won't be applicable in my situation. Do we foresee a fix for this soon? I'm under a bit of time-crunch. Thanks in advance for any help.
 

yfleury

Active Member
Licensed User
Longtime User
In installation page for B4J
Rich (BB code):
Installation
1.Oracle Java 8 or OpenJDK 11/14
Download one of the following JDKs. Note that OpenJDK 11+ requires Windows 64 bit.
Recommended: OpenJDK 14 + OpenJFX 14: download link.
License: GPL + classpath exception. License permits usage in closed commercial projects.

Go to this link https://www.b4x.com/b4j.html
 
Upvote 0

chikega

Member
Licensed User
Using Oracle's JDK 20, I get a B4J compile-time error saying
Compiler error:
Compiling generated Java code. Error
error: Source option 7 is no longer supported. Use 8 or later.

javac 20

The oft-suggested workarounds like "use an earlier JDK" won't be applicable in my situation. Do we foresee a fix for this soon? I'm under a bit of time-crunch. Thanks in advance for any help.
I get the same error using JDK 20. But it appears JDK 17 LTS works on my end.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
That link won't help. I think Erel has to change B4J to change the compiler source option. I seem to remember a similar problem when B4J was compiling with source option 6 and that became deprecated in Java 11 (I think!) with source option 7 then required.
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
The JDK 20 he is using is not the recommended one in the B4J installation link.

To make other unsupported openJDK work with B4J you have to follow the steps.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
You could try adding (edit it for the version you use)

B4X:
	#JavaCompilerPath: 22, C:\jdk-22\bin\

Without it I get the same error you had, with it, compile runs and works.
 
Last edited:
Upvote 0
Top