file format
A Java class file is a file (with the .class filename extension) containing Java bytecode that can be executed on the Java Virtual Machine (JVM). A Java class file is usually produced … Wikipedia
Factsheet
Internet media type application/java-vm, application/x-httpd-java, application/x-java, application/java, application/java-byte-code, application/x-java-class, application/x-java-vm
Developed by Sun Microsystems
Factsheet
Internet media type application/java-vm, application/x-httpd-java, application/x-java, application/java, application/java-byte-code, application/x-java-class, application/x-java-vm
Developed by Sun Microsystems
🌐
Wikipedia
en.wikipedia.org › wiki › Java_class_file
Java class file - Wikipedia
May 30, 2026 - A Java class file is a file (with the .class filename extension) containing Java bytecode that can be executed on the Java Virtual Machine (JVM). A Java class file is usually produced by a Java compiler from Java programming language source files ( .java files) containing Java classes ...
🌐
Reddit
reddit.com › r/feedthebeast › how to open and edit a .class file
r/feedthebeast on Reddit: How to open and edit a .class file
November 12, 2021 -

Can someone please tell me how to open and edit a .class file of a 1.16.5 mod. What program should I use?

Top answer
1 of 4
10
Instead of doing that, check if the mods source code is available and try to find the corresponding .java (or whatever) file and edit that. You can use decompilers, possibly in combination with some deobfuscator to get source back from a .class file, but it would likely be "breaking the rules" unless you have the authors approval. There have been cases where such approval has been granted (see GregTech for example), but usually when the mod author is ok with you modifying their mod, they'll give you the source code straight away.
2 of 4
9
A class file in JAVA is bytecode so cannot be read by a normal text editor as it is meant to be interpreted by the JVM and converted into machine code. It needs to be decompiled to be read and have its references available so you’d probably actually want to read the .jar archive. The program I find best to do this is jd-gui. Which is a GUI frontend for the dedicated Java Decompiler JD. You feed it a jar file and it will display its contents decompiled. You will still be able to search for the class you want but you’ll have to understand how to read Java. Be warned though, the mod may have obfuscated references to the Minecraft jar. This means it may not have readable MCP mappings or Searge mappings and instead reference class net.minecraft.a instead. You probably need to decompile the minecraft.jar for your version too and cross reference that with the mappings you wish to use. You can find the 1.16.5 jar on windows at %APPDATA%/.minecraft/versions/1.16.5/1.16.5.jar. Another problem is the code may be closed source so if you are attempting to remake a mod be careful of licensing and if you need then ask for permission from the mod author. Most mods are open source so it may be worth checking out the mod on curseforge or the minecraft forums and seeing if it links to source as a tab or the description may mention a github that you can look at instead
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-class-file
Java Class File - GeeksforGeeks
A Java class file is a file containing Java bytecode and having .class extension that can be executed by JVM. A Java class file is created by a Java compiler from .java files as a result of successful compilation.
Published   November 16, 2024
🌐
Oracle
docs.oracle.com › javase › specs › jvms › se7 › html › jvms-4.html
Chapter 4. The class File Format
March 16, 2026 - A class file consists of a stream of 8-bit bytes. All 16-bit, 32-bit, and 64-bit quantities are constructed by reading in two, four, and eight consecutive 8-bit bytes, respectively. Multibyte data items are always stored in big-endian order, where the high bytes come first.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › nio › file › Files.html
Files (Java Platform SE 8 )
April 21, 2026 - Java™ Platform Standard Ed. 8 ... This class consists exclusively of static methods that operate on files, directories, or other types of files.
🌐
W3Schools
w3schools.com › java › java_files.asp
Java Files
Java has several methods for creating, reading, updating, and deleting files. The File class from the java.io package, allows us to work with files.
Find elsewhere
🌐
Java Almanac
javaalmanac.io › bytecode › versions
Class File Versions - javaalmanac.io
Java Bytecode · Each JDK Release comes with its class file version. Class files are backward compatible. But class files compiled for newer JDK releases cannot be executed and will result in an UnsupportedClassVersionError. A class file version consists of a major and a minor version: <major>.<minor> For recent JDK releases, the major version is incremented for every release and the minor version is 0.
🌐
GeeksforGeeks
geeksforgeeks.org › java › file-class-in-java
Java File Class - GeeksforGeeks
November 3, 2025 - The File class in Java is used to represent the path of a file or folder. It helps in creating, deleting, and checking details of files or directories, but not in reading or writing data.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › io › File.html
File (Java Platform SE 8 )
April 21, 2026 - Instances of the File class are immutable; that is, once created, the abstract pathname represented by a File object will never change. The java.nio.file package defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.
🌐
OpenJDK
openjdk.org › jeps › 484
JEP 484: Class-File API
June 21, 2024 - The JDK has its own class-file library inside the javac compiler. It also bundles ASM to implement tools such as jar and jlink, and to support the implementation of lambda expressions at run time. Unfortunately, the JDK's use of a third-party library causes a tiresome delay in the uptake of new class-file features across the ecosystem.
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-files-nio-files-class
Java Files - java.nio.file.Files Class | DigitalOcean
August 4, 2022 - This class is used for basic file operations like create, read, write, copy and delete the files or directories of the file system. Before move ahead let’s have a look at the below terms first: Path: This is the interface that replaces java.io.File class as the representation of a file or ...
🌐
Hyperskill
hyperskill.org › university › java › java-files
Java Files
December 3, 2024 - In this topic, we will learn how to work with files directly from a Java program. There is a class called File in the java.io package. An object of this class represents an existing or non-existing file or a directory.
🌐
Medium
medium.com › @AlexanderObregon › the-anatomy-of-a-java-virtual-machine-class-file-e3773d23f3e3
The Anatomy of a Java Virtual Machine Class File
January 10, 2024 - The Java Virtual Machine (JVM) ... running the JVM. Central to this mechanism is the .class file, which is the compiled version of Java source files....
Top answer
1 of 5
9

The JVM is by definition a virtual machine, that is a software machine that simulates what a real machine does. Like real machines it has an instruction set (the bytecodes), a virtual computer architecture and an execution model. It is capable of running code written with this virtual instruction set, pretty much like a real machine can run machine code.

So, the class files contain the instructions in the virtual instruction set, and it is capable of running them. For that matter, a virtual machine can either interpret the code itself or compile it for the hardware architecture it is currently running. Some do both, some do just one of them (e.g. .net runtime compiles once the first time the method is called).

For instance, the Java HotSpot initially interprets bytecodes, and progressively compiles the code into machine code. This is called adaptive optimization. Some virtual machines always compile to machine code directly.

So, you can see there are two different "compiling concepts". One consists in the transformation of Java code to JVM bytecodes (From .java to .class). And a second compilation phase happens when the program runs, where the bytecodes may either be interpreted or compiled to actual machine code. This is done by the just-in-time compiler, within the JVM.

So, as you can see, a computer cannot run a Java program directly because the program is not written in a language that the computer understands. It is written in lingua-franca that all JVM implementations can understand. And there are implementations of that JVM for many operating systems and hardware architectures. These JVMs translate the programs in this lingua-franca (bytecodes) for any particular hardware (machine code). That's the beauty of the virtual machine.

2 of 5
5
  1. The .class file is machine-readable. The machine that reads it is the Java Virtual Machine, which interprets it and compiles it to native code (executable by your computer).

  2. You don't need the .java files to run Java code. The .class files are all you need.

🌐
CodeGym
codegym.cc › java blog › java io & nio › java.io.file class
Java.io.File Class
June 6, 2022 - File(File parent, String name) creates a new File instance from a file abstract pathname and a name pathname string. File(URI uri) in this case constructor creates a new File instance by converting the given file: URI into an abstract pathname.
🌐
Codefinity
codefinity.com › courses › v2 › 50afb341-f062-4e2b-8869-119864e9e490 › bb705a9c-4b98-4165-aaee-37bf1ae1e98d › 9f5f45e2-ee7d-433c-b17b-e8a9b14cf7fc
Learn The File Class | Java File I/O Essentials
The File class provides a way to encapsulate the concept of a file or directory path in the file system, allowing you to check for their existence, retrieve properties, and perform basic operations.
🌐
GitHub
github.com › skylot › jadx
GitHub - skylot/jadx: Dex to Java decompiler · GitHub
On Windows run .bat files with double-click Note: ensure you have installed Java 11 or later 64-bit version. For Windows, you can download it from oracle.com (select x64 Installer). ... jadx[-gui] [command] [options] <input files> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc, .aab, .xapk, .apkm, .jadx.kts) commands (use '<command> --help' for command options): plugins - manage jadx plugins options: -d, --output-dir - output directory -ds, --output-dir-src - output directory for sources -dr, --output-dir-res - output directory for resources -r, --no-res - do not decode resources -s, --n
Starred by 49.6K users
Forked by 5.7K users
Languages   Java 92.0% | Smali 6.6% | Kotlin 1.1%
🌐
GitHub
github.com › openjdk › jdk › blob › master › src › java.base › share › classes › java › nio › file › Files.java
jdk/src/java.base/share/classes/java/nio/file/Files.java at master · openjdk/jdk
import java.util.stream.StreamSupport; ...AbstractFileSystemProvider; · /** * This class consists exclusively of static methods that operate on files, * directories, or other types of files....
Author   openjdk
🌐
crio community
forum-external.crio.do › expert posts
What is the purpose of the File class in Java? - Expert Posts - crio community
March 24, 2025 - What is the Purpose of the File Class in Java? The File class in Java is used to represent file and directory pathnames in an abstract manner. It provides methods to: 1. Create, delete, and rename files and directories.