--- title: ".java file — what it is and how to open it" description: "A .java file is a Java Source. Java source code in plain text, compiled to .class files before it runs. How to open one on Windows, macOS and Linux, and what to convert it to." url: https://atoneplace.net/file/java/ site: "At One Place" --- # .java files **.java file: Java Source** Java source code in plain text, compiled to .class files before it runs. ## What opens a .java file - **Windows:** Visual Studio Code, IntelliJ IDEA, Eclipse, Notepad (built in) - **macOS:** Visual Studio Code, IntelliJ IDEA, TextEdit (built in) - **Linux:** Visual Studio Code, IntelliJ IDEA, Text Editor (built in) ## What a .java file is A .java file holds human-readable Java source. It does not run as-is: the compiler turns it into bytecode (.class), which the Java Virtual Machine executes, and a set of those is usually bundled into a .jar. The language convention is that the file name matches the public class inside it, so renaming one breaks the build. ## Converting it A .java file is commonly converted to .class, .jar or .txt. It is a plain text format, so any text editor can open and edit it directly. ## Details - **Extension:** .java - **Full name:** Java Source - **Category:** Code and scripts - **MIME type:** text/x-java-source - **Created by:** Sun Microsystems / Oracle - **Format:** Plain text ## Common questions ### How do I open a .java file? On Windows use Visual Studio Code; on macOS use Visual Studio Code; on Linux use Visual Studio Code. Java source code in plain text, compiled to .class files before it runs. ### What is a .java file? Java Source. A .java file holds human-readable Java source. It does not run as-is: the compiler turns it into bytecode (.class), which the Java Virtual Machine executes, and a set of those is usually bundled into a .jar. ### Can I convert a .java file? Yes. It is usually converted to .class, .jar or .txt, either by exporting from one of the programs listed above or with a format converter. ## Related pages - [.html — HyperText Markup Language](https://atoneplace.net/file/html/) - [.js — JavaScript Source](https://atoneplace.net/file/js/) - [.css — Cascading Style Sheet](https://atoneplace.net/file/css/) - [.py — Python Source](https://atoneplace.net/file/py/) - [.tsx — TypeScript Source (JSX)](https://atoneplace.net/file/tsx/) - [.cpp — C++ Source](https://atoneplace.net/file/cpp/) - [.php — PHP Source](https://atoneplace.net/file/php/) - [.c — C Source](https://atoneplace.net/file/c/) - [.cs — C# Source](https://atoneplace.net/file/cs/) - [.go — Go Source](https://atoneplace.net/file/go/) - [.rs — Rust Source](https://atoneplace.net/file/rs/) - [.rb — Ruby Source](https://atoneplace.net/file/rb/) ## Sources - Media Types Registry — IANA (https://www.iana.org/assignments/media-types/) - Official vendor product documentation — At One Place (/about/)