java2faas
raw JSON → 0.3.2 verified Fri May 01 auth: no javascript abandoned
CLI tool that transpiles Java code for deployment to AWS Lambda and IBM Cloud Functions. Version 0.3.2. It converts a local Java project into deployable artifacts (with Maven support) for two cloud providers simultaneously. Differentiated by handling both Amazon and IBM from a single source, automatically generating deployment scripts. Suitable for simple Java functions on Java 8. No active development since 2019.
Common errors
error Error: Cannot find module 'java2faas' ↓
cause Package not installed or not in PATH
fix
Run 'npm i -g java2faas' or use npx: 'npx java2faas ...'
error sh: deploy.sh: No such file or directory ↓
cause java2faas did not generate the amazon/ibm directories
fix
Verify options: --path must point to project root with src/main/java structure.
error Class not found: Request/Response ↓
cause Request.java or Response.java missing correct getters/setters or no-arg constructor
fix
Ensure both classes have getter for each field, setter for each field, and a public no-argument constructor.
Warnings
gotcha Package not updated since 2019 and has low downloads; consider alternatives like CDK or Terraform for production deployments. ↓
fix Use AWS CDK or Terraform with Java runtime.
gotcha Only supports Java 8; Java 11+ features may break. ↓
fix Ensure your code targets Java 8 bytecode.
gotcha Requires Request.java and Response.java to have getters/setters; otherwise compilation fails. ↓
fix Include proper JavaBean patterns (getters, setters, no-arg constructor).
gotcha CLI options are case-sensitive and not validated; typo in --aws-role will cause silent failure. ↓
fix Double-check option spelling: --aws-role (not --awsRole).
Install
npm install java2faas yarn add java2faas pnpm add java2faas Imports
- java2faas wrong
const java2faas = require('java2faas')correctimport { java2faas } from 'java2faas' - CLI wrong
import CLI from 'java2faas'correctimport { CLI } from 'java2faas/cli' - Transpiler wrong
import { transPiler } from 'java2faas'correctimport { Transpiler } from 'java2faas'
Quickstart
npm i -g java2faas@0.3.2
java2faas --path . --name myFunction --entry-file src/main/java/Hello.java --entry-method hello --aws-role arn:aws:iam::123456789012:role/lambda-role