Java
Java is Curie's default language. Any *.java files found in the source tree are compiled automatically — no configuration required.
Source layouts
Curie recognises two directory conventions and they can coexist in the same project:
- Flat-package — the package name becomes the directory name, with dots kept as-is:
src/com.example/Greeter.java - Maven — the conventional Maven source root:
src/main/java/com/example/Greeter.java
Both layouts are discovered by scanning for *.java files. You can migrate from Maven layout to flat-package layout gradually — Curie will compile whichever files it finds.
Java version
The [java] section controls the language version. When releaseVersion is set, curie passes --release to javac, fixing the source language, bytecode major version, and available APIs simultaneously:
[java] releaseVersion = "21" # pin to Java 21 language + APIs
When releaseVersion is absent (the default), curie omits --release entirely and javac targets the running JDK's own version automatically. Curie rebuilds the project whenever the JDK version changes, so builds stay correct even without an explicit pin.
Main class auto-detection
For [application] projects, Curie scans compiled .class files looking for a public static void main(String[]) method. If exactly one is found it is used automatically; if zero or more than one are found, the build fails with a message listing the candidates — set mainClass explicitly to resolve the ambiguity:
[application] name = "my-app" version = "1.0.0" mainClass = "com.example.Main" # explicit override
Preview features
To enable Java preview features, set enablePreview = true. Curie passes --enable-preview to javac and to the JVM at test-run time. When no releaseVersion is set, curie automatically supplies --release with the running JDK's version (required by javac when --enable-preview is used):
[java] enablePreview = true # targets running JDK, enables its preview features
Instance main methods (Java 21+)
Curie also detects "simplified" entry points — a class with a void main() instance method and no class declaration boilerplate (finalized in Java 25, JEP 512; preview in Java 21–24):
// no class wrapper required void main() { System.out.println("Hello!"); }
On Java 25+ this works with no additional configuration. On Java 21–24 add enablePreview = true to [java]. See examples/simplified-main for a complete working example.
Annotation processors
Processors (Lombok, AutoValue, MapStruct, …) run during compilation when declared under [annotation-processors]. They are placed on the annotation processor path, not the regular classpath:
[annotation-processors] "org.projectlombok:lombok" = "1.18.32" [test-annotation-processors] "com.example:test-proc" = "1.0.0"
Some processors (Lombok in particular) also need to be on the compile classpath so their annotations are visible to javac. Set on-compile-classpath = true for those:
[annotation-processors] "org.projectlombok:lombok" = { version = "1.18.32", on-compile-classpath = true }