Call java command

0.0.1

CLI Assured offers the CliAssured.java() factory method to create a CommandSpec instance with the java executable of the current JVM process pre-configured. The executable is resolved from the java.home system property.

import org.cliassured.CliAssured;

CliAssured
    // Use the java executable of the current JVM
    .java()
        .args("-version")
    .then()
        // java -version prints to stderr
        .stderr()
            .hasLinesContaining(System.getProperty("java.version"))
    .execute()
    .assertSuccess();