Skip to content

feat: Add Java and Kotlin support to sandbox #29

Description

@itigges22

Description

The sandbox currently supports Python, JavaScript, TypeScript, Go, Rust, C, C++, and Bash. Java and Kotlin are widely used and would broaden ATLAS's usefulness for more developers.

Requirements

  • Add Java compilation and execution (javac + java)
  • Add Kotlin compilation and execution (kotlinc + kotlin or kotlinc to JAR)
  • Add language detection in sandbox/executor_server.py
  • Add language aliases (e.g., java, kt, kotlin)
  • Install JDK and Kotlin compiler in sandbox Dockerfile
  • Add tests for both languages
  • Update docs/TROUBLESHOOTING.md supported languages list

Context

The sandbox architecture is straightforward — each language needs a compile step and a run step. See existing implementations in sandbox/executor_server.py for the pattern.

Activity

  1. itigges22 commented on May 12, 2026

    @itigges22
    CollaboratorAuthor

    Status — half-shipped. The sandbox restructure in V3.1.0 (PC-191/192/193) added language-agnostic layout detection that recognizes Java and C/C++ project layouts and picks the right runner. From the CHANGELOG: "Detects Python, Node, Go, Rust, Java, C/C++ project layouts and uses the appropriate runner."

    What's still missing for this ticket: actual Java / Kotlin runtime install in the sandbox container, and the executor entries. sandbox/executor_server.py still gates on python | javascript | typescript | go | rust | c | cpp | bash, and the Dockerfile doesn't install openjdk or kotlinc. Layout detection is the harder half; runtime install is mostly a Dockerfile addition + executor wiring once someone wants to claim it.

  2. Anuj-72 commented on Jul 7, 2026

    @Anuj-72
    Contributor

    Hi @itigges22, I'd like to pick this up!

    I've read through the codebase and your status update — layout detection is already in place from V3.1.0, so this is the Dockerfile + executor wiring half.

    My plan:

    I'll split this into two focused PRs for cleaner review:

    PR 1 — Java support:

    • sandbox/Dockerfile: install openjdk-21-jdk-headless
    • sandbox/executor_server.py: add "java" to SUPPORTED_LANGUAGES, normalize_language(), /languages check, /execute gate, _syntax_check_impl (javac), new execute_java() (javac → java -cp), LANGUAGE_HANDLERS registration
    • v3-service/main.py: add "java" to verified_languages + .java to _ext_to_lang
    • docs/TROUBLESHOOTING.md + docs/ARCHITECTURE.md: update supported language lists
    • tests/infrastructure/test_sandbox_java_kotlin.py: Java execution + syntax check + error handling tests

    PR 2 — Kotlin support (follow-up):

    • Same pattern, using kotlinc -include-runtime -d program.jar → java -jar for the compile/run step
    • Kotlin compiler installed from official GitHub release ZIP
    • "kotlin" / "kt" aliases

    Both PRs follow the existing execute_go / execute_rust compile-then-run pattern exactly.

    Happy to start on PR 1 right away if this approach works!

  3. itigges22 commented on Jul 8, 2026

    @itigges22
    CollaboratorAuthor

    @Anuj-72 Approved - the two-PR split works, and your file list is right. Three tips before you start:

    1. javac needs the file named after its public class (the other handlers use fixed filenames) - have execute_java() extract the class name, falling back to Main.
    2. CI boots the executor on the host runner, which has no JDK - gate your tests with skipif(shutil.which("javac") is None), and include docker compose exec sandbox test output in the PR description.
    3. Use --no-install-recommends for the JDK, and pin the Kotlin ZIP by version + SHA-256 (everything fetched at build time here is checksum-pinned).

    Base both PRs on a fresh pull of dev. Assigning you now!

  4. itigges22 commented on Jul 13, 2026

    @itigges22
    CollaboratorAuthor

    Kotlin support landed in #140 (merge commit e2fbe91), completing this issue — Java support landed earlier. Promoted through dev → staging → main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions