Run Java code
Use the runCode
/run_code
method to run Java code inside the sandbox.
You'll need to pass the language
parameter with value java
.
import { Sandbox } from '@e2b/code-interpreter'
const sbx = await Sandbox.create()
const execution = await sbx.runCode('System.out.println("Hello, world!");', { language: 'java' })
console.log(execution)