I am using GraalVM and am building a serverless AWS Lambda.
The command I am running to make the binary:
native-image --no-server --no-fallback --enable-url-protocols=http -jar /build/libs/HelloWorldFunction.jar -H:Name=application
My build.gradle:
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
def lambdaName = "HelloWorldFunction"
group = 'org.example'
version = '1.0-SNAPSHOT'
application {
mainClassName = 'com.amazonaws.services.lambda.runtime.api.client.AWSLambda'
}
shadowJar {
archiveBaseName.set(lambdaName)
archiveClassifier.set('')
archiveVersion.set('')
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.amazonaws:aws-lambda-java-core:1.2.3'
implementation 'com.amazonaws:aws-lambda-java-events:3.13.0'
implementation 'com.amazonaws:aws-lambda-java-runtime-interface-client:2.6.0'
}
Error message:
Failed to load the native runtime interface client library libaws-lambda-jni.linux-x86_64.so. Exception: Specified file not in the JAR: libaws-lambda-jni.linux-x86_64.so
Failed to load the native runtime interface client library libaws-lambda-jni.linux-aarch_64.so. Exception: Specified file not in the JAR: libaws-lambda-jni.linux-aarch_64.so
Failed to load the native runtime interface client library libaws-lambda-jni.linux_musl-x86_64.so. Exception: Specified file not in the JAR: libaws-lambda-jni.linux_musl-x86_64.so
Failed to load the native runtime interface client library libaws-lambda-jni.linux_musl-aarch_64.so. Exception: Specified file not in the JAR: libaws-lambda-jni.linux_musl-aarch_64.so