Skip to content
TheFilesGuy
en
Menu

Web & code · .java

What Is a JAVA File?

A .java file is source code written in the Java programming language.

Extension
.java
Full name
Java source file
Type
Web & code
MIME type
text/x-java-source

Free JAVA Tools

These run in your browser. Your JAVA files are never uploaded.

About JAVA Files

A .java file holds source code in Java, a language used for Android apps, enterprise software and server applications. It must be compiled into .class files, which are often packaged in a .jar, before it can run. Like other source code, it is plain text that any editor can open; IntelliJ IDEA, Eclipse and VS Code add highlighting and tools.

How to Open a JAVA File

Any device
Open it in a text editor, VS Code, IntelliJ IDEA or Eclipse.
Run it
Install a JDK and run java File.java (Java 11+) or compile with javac.

JAVA File Questions

What's the difference between .java and .jar?

A .java file is source code. A .jar is a compiled, packaged program.

How do I run a .java file?

With Java 11 or later, run java File.java. For larger projects, compile with javac or a build tool.

See all file formats