Trusted answers to developer questions

What are JAR files in Java?

Free System Design Interview Course

Many candidates are rejected or down-leveled due to poor performance in their System Design Interview. Stand out in System Design Interviews and get hired in 2024 with this popular free course.

A JAR file is simply the compressed version of Java class files and all the subsidiary resources like (image files, audio files, etc.). It is more of an archived package file that can be unarchived very easily using any tool (e.g., WinZip). JARs have the jar extension.

Remember: All Java files (*java) are usually converted into a single jar file.

Commands

commands meaning
cf It converts the specified file into a jar file.
tf It is used to view the contents of a jar file.
xf It is used to extract all the contents of a jar file.
-jar It is used to run the jar file.

Illustration

1 of 5

RELATED TAGS

jars
jar
files
java
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?