1

We have a legacy Java project we might run as an AWS lambda function. However, this project does not use Maven, and we are not very interested (read: hard pass) in adding Maven to it, in any form. (We do not use Java for new projects, and have no desire to add complexities.)

Is there a way to run a Java project in lambda without using Maven?

4
  • 5
    It will take 10 minutes to get Maven or Gradle running. It will take you hours to manually build a Lambda and properly package it. Commented Mar 9, 2021 at 22:41
  • How do you build your Java code now - a shell/batch script? Commented Mar 9, 2021 at 22:57
  • If you do not use Maven or Gradle - you need to manually add JARs to your class path. As stated above - its 10 mins to setup a Maven project vs hours of trying to hunt down the proper JARS and adding them to your class path. Commented Mar 9, 2021 at 23:20
  • Why do you hate Maven? Commented Mar 10, 2021 at 6:41

1 Answer 1

2

I would still suggest to use a tool like Maven or Gradle to manage all dependencies. If you really insist, you can package the ZIP file containing all class files in the root of the ZIP, and all required libraries in folder called 'lib' in the ZIP file:

Main.class
Another.class
lib/
  mysql.jar
  otherlib.jar

You can upload this ZIP to the AWS console. For more information see https://docs.aws.amazon.com/lambda/latest/dg/java-package.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.