From AWS web console, tried Create function in Java for lambda. Since Code editor does not support compiled languages, cannot view the code. So thought of exporting the lambda function as zip file to check the source files. But the downloaded zip for Java does not include the source files. What is the reason behind that? Please note that the question is not on how to derive java files from byte code, but why the zip file does not include the java files which are precursor to the class files.
Asked
Active
Viewed 128 times
-4
-
How did the code get there in the first place? – DanielBarbarian Sep 23 '21 at 07:35
-
*"But the downloaded zip has only .class files. Any way to view the src files?"* - you can use a java decompiler for this. Note that this is entirely unrelated to AWS or Lambda. – luk2302 Sep 23 '21 at 07:36
-
Clarifying my question - The zip file for Java does not include the source files. What is the reason behind that? – kakoli Sep 23 '21 at 07:47
-
1Because it is compiled, because that is how java works, a compiled zip/jar should not contain source files. – luk2302 Sep 23 '21 at 08:04
-
I think the correct statement - executable jar file need not have src files. But having them also should not give errors. And in this case, it is the default/inbuilt java lambda function. – kakoli Sep 23 '21 at 09:44
-
1Of course it does not give errors, you can include whatever you want into the jar/zip, but it simply is not how things are done, the source files are not bundled in the jar, basically ever. – luk2302 Sep 23 '21 at 10:27
1 Answers
-3
if you have access to the aws web console, you probably have access to the repository. you can just clone the repository and get the code from there.
with regards to your problem, you could check the AWS SAM tutorial from AWS: link
it's a step by step hello world function that uses AWS SAM and lambda
here's a repo that uses aws lambda with java, maybe it could help: repo

ceruleansea
- 19
- 2
-
1*"if you have access to the aws web console, you probably have access to the repository. you can just clone the repository and get the code from there."* - that is a very bold claim, the two are completely unrelated. And what does SAM have to do with anything? – luk2302 Sep 23 '21 at 08:08
-
To add a second note to "you probably have access to the repository" - what repository, where, what user credentials? CodeCommit, Github, GitLab, Bitbucket, custom git server? – luk2302 Sep 23 '21 at 09:05