How to install additional software and programs (such as Java) on lambda via serverless?

I’m working with a python package that requires java. Is it possible to install Java - or other software - inside lambda via serverless? It appears that AWS Chalice can do this, see [1], so I’m assuming it might be possible with serverless.


[1] How to install third-party command line software on AWS Lambda function using Python Chalice (2019). Available at: (Accessed: 28 May 2021).