B4J Question [RESOLVED I think] java version for AWS Lambda

JackKirk

Well-Known Member
Licensed User
Longtime User
Hi,

I'm after a bit of java knowledge that escapes me.

I would like to explore using AWS Lambda (https://docs.aws.amazon.com/lambda/latest/dg/welcome.html)

There seem to be a range of java runtimes that can be used (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) including:

Java 21
Java 17
Java 11
Java 8

The B4J installation notes essentially recommend Oracle Java 8 or OpenJDK 14 and I'm currently using OpenJDK 14.

How do these correlate, if at all, to the AWS Lambda runtimes?

Thanks in anticipation...
 

Daestrum

Expert
Licensed User
Longtime User
Looks like they just list the LTS versions of Java
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Last edited:
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Also, it raises a question: when will B4X "support" (if that is the right word) later LTS java releases?
I currently use Java 22 & 21 - the IDE is quite happy using them. (The Java folder structure setup is the same as Java11) .
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
I currently use Java 22 & 21 - the IDE is quite happy using them. (The Java folder structure setup is the same as Java11) .
Being the conservative bugger I am, I worry that there might be some hidden pothole - why is Erel only advocating Oracle Java 8 or OpenJDK 14?
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
You can use a newer version of Java.
OpenJDK 19 is available here: https://www.b4x.com/android/forum/threads/jgooglemaps-library.56744/#content
Erel, sorry to be picky but AWS is saying

Java 21
Java 17
Java 11
Java 8

Which are apparently "long term support".

Questions:
  • Any idea if OpenJDK 19 could be used in lieu of (say) Java 17?
  • I see there are OpenJDK 17 and 21 releases available - are they "sanctioned" for use with B4X?
  • If an Oracle version is long term support does this mean that the corresponding OpenJDK version will also be?
Thanks...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
I subscribe to AWS paid support.

I opened a case:
The response was:
My interpretation is that I should be able to use OpenJDK 17 or 21 as far as they are concerned.

Now to see if B4X does not hiccup...
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
My interpretation is that I should be able to use OpenJDK 17 or 21 as far as they are concerned.

Now to see if B4X does not hiccup...
If you are worried about it, you can always install the appropriate Amazon Corretto and use it for the B4J projects that involve targeting AWS Lambda Java. You can use the #JavaCompilerPath attribute (see https://www.b4x.com/android/forum/threads/b4j-v8-80-has-been-released-🍾.125536/#content) to tell your project to use Amazon Corretto instead of the JDK set up in the B4J IDE.
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Thanks OliverA, for anyone interested this looks like the way to go:

https://aws.amazon.com/corretto/?fi...ds.createdDate&filtered-posts.sort-order=desc
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…