I have been trying to run the Java code example in the Getting Started (Authoring AWS Lambda Code in Java) in this page but I am stuck as com.amazonaws.services.lambda.runtime package looks like its missing.
Showing the sample code below:
package example;
import com.amazonaws.services.lambda.runtime.Context; //package does not exist error
import com.amazonaws.services.lambda.runtime.LambdaLogger; // package does not exist error
import com.amazonaws.services.s3.AmazonS3; // import works (not needed, I've put them in for testing import)
import com.amazonaws.services.s3.model.S3Object; // import works (not needed, I've put them in for testing import)
public class Hello {
public String myHandler(int myCount, Context context) {
LambdaLogger logger = context.getLogger();
logger.log("received : " + myCount);
return String.valueOf(myCount);
}
}
I am facing the same error both in Netbeans and in command line even after mentioning the aws sdk thorugh -cp argument from the first 2 imports in the code below:
package com.amazonaws.services.lambda.runtime does not exist
While importing other packages from the SDK its working fine, as from the third and the fourth imports in the above code the s3 imports which I put in just to test. I am using version 1.10.2 aws-java-sdk-1.10.2.zip of the AWS Java SDK.
All of your suggestions and helps are welcome! Thanks in Advance!