.CLASS - File Extension for Java Bytecode Files

Q

File extension CLASS is used for Java compiled class files. A CLASS sample file is provided. Free JVM applications to run CLASS files are listed.

✍: FYIcenter.com

A

File Extension: .CLASS

File Content: Java compiled bytecode.

What is CLASS? CLASS is an object-oriented programming team. A class is a basic unit of program that defines a blueprint from which individual objects are created.

CLASS is the file extension for files storing Java classes in bytecode format.

Software applications written in Java are stored in two formats:

  • Source Code - Stored in files with .JAVA extension.
  • Bytecode - Stored in files with .CLASS extension. .CLASS files are compiled from .JAVA files.

.CLASS files are binary files. Here are the first 128 bytes of a sample CLASS file dumped in HEX values:

ca fe ba be 00 00 00 32 00 1d 0a 00 06 00 0f 09 .......2........
00 10 00 11 08 00 12 0a 00 13 00 14 07 00 15 07 ................
00 16 01 00 06 3c 69 6e 69 74 3e 01 00 03 28 29 ......init......
56 01 00 04 43 6f 64 65 01 00 0f 4c 69 6e 65 4e V...Code...LineN
75 6d 62 65 72 54 61 62 6c 65 01 00 04 6d 61 69 umberTable...mai
6e 01 00 16 46 59 49 63 65 6e 74 65 72 28 5b 4c n.....Ljava.lang
2f 53 74 72 69 6e 67 3b 29 56 01 00 0a 53 6f 75 .String..V...Sou
72 63 65 46 69 6c 65 01 00 0c 57 65 6c 63 6f 6d rceFile...Welcom

"0xcafebabe" seems to be the file marker for CLASS files.

CLASS sample file: Click Welcome.class to download.

Java bytecode stored in CLASS files can be executed by a number of free Java Virtual Machine software:

  • Java HotSpot - Runs CLASS files. Developed by Sun Microsystems.
  • JRockit - Runs CLASS files. Developed by BEA Systems.

2021-07-12, 20668👍, 3💬