Java Compiler

Compile Java source with Elide

elide javac runs the Java compiler included with Elide. Elide 1.5.0 supports Java 25.

Compile source files

Put javac options and source paths after --:

elide javac -- -d out src/Hello.java
elide java -- -cp out Hello
Compiling and running Java source with Elide

Without -d, class files are written beside their source files, as with standard javac.

For the compiler’s complete option list:

elide javac -- -help

Compile and create a JAR

The Elide-specific --jar and --manifest options go before --:

elide javac --jar target/app.jar -- src/Main.java src/Util.java
elide javac --jar target/app.jar --manifest src/MANIFEST.MF -- src/Main.java

Build projects

elide build compiles Java source sets declared in elide.pkl. To run only the conventional main Java compilation task:

elide build compile-java-main

Compiler flags belong in the manifest:

jvm {
  java {
    compiler {
      flags { "-verbose" }
    }
  }
}

See Elide Projects for source sets and JAR Assembly for packaging.