Skip to content

codingame_tools.language.languages.java

java

CgJavaLanguage: CgLanguage for CodinGame's "Java"--extension and toolchain fragment only; local execution and contribution-create stub generation aren't implemented yet.

CgJavaLanguage

CgJavaLanguage()

Bases: CgLanguage

Source code in codingame_tools/language/languages/java.py
14
15
def __init__(self) -> None:
    super().__init__("Java")

toolchain_fragment property

toolchain_fragment

Installs nothing itself: the JDK is the jdk21 subsystem, which no other language may share -- Clojure, Groovy and Scala need JVM 1.8, and CodinGame keeps four JDKs side by side for exactly that reason.

CG_JAVA_CLASSPATH carries gson because CodinGame does: a measured run reports java.class.path containing /codemachine/lib/java/external/gson.jar. It is absent from their published table, so a solution importing com.google.gson would compile there and fail here without it.

A solution must be class Solution with a public static void main(String[]), which is what CodinGame's own stub provides.