Java Compact File

Create a compact source file in IntelliJ IDEA.

To create a Java Compact File, introduced in Java 25, right-click the src/main/java directory in the Project tool window and select New | Java Compact File. IntelliJ IDEA will provide a default name for the file, so your thought process is not disrupted when you want to quickly try something out. IntelliJ IDEA automatically adds an instance main method void main() to the file.

Interested in JVM Development?

call to action image

Did you know there is another way to create a compact source file in IntelliJ IDEA?

Learn More

Related Resources

Add arguments
Add arguments
Add args to your main method.
Compact source file
Compact source file
Create a compact source file in IntelliJ IDEA.
Convert compact source file to class
Convert compact source file to class
Convert a compact source file to a class in IntelliJ IDEA.