Java, Maven and Gradle 25 · Compile and run

Run with a classpath

Put a folder of jars and the current folder on the classpath.

java -cp "lib/*:." com.example.Main

Official Java, Maven and Gradle 25 documentation

More compile and run commands

All compile and run commands · Java, Maven and Gradle 25 cheatsheet

Was this page helpful?