.java · 100% private

Open Java files online

Drop a Java file to preview it instantly in your browser. Free and private: your file is never uploaded, and no account is needed.

Drop your Java file here
or click to browse your device
file
Preview
Drop a file on the panel above to begin
Files never leave your device No sign-up, no account Free forever

What is a Java file?

A .java file contains source code written in Java, a statically typed language used for Android apps, enterprise back ends and big-data tools.

Each public class lives in a file with the same name, and the compiler turns it into .class bytecode that runs on the Java Virtual Machine.

Full nameJava Source File
File extension.java
MIME typetext/x-java-source
Developed bySun Microsystems (now Oracle)
Introduced1995

How to open a Java file online

  1. Drop the file. Drag your .java file onto the panel at the top of this page, or click it to pick the file from your device.
  2. See it instantly. Your browser reads the file locally and shows the preview in a second or two.
  3. View full screen or download. Use the full screen button for a distraction-free view, or download a copy. Close the page when you are finished and nothing is kept.

How Drop and Open displays Java files

Drop and Open reads the file locally as UTF-8 text and shows it in a monospace block with line breaks preserved. The content is inserted as plain text, so nothing inside the file can run. No syntax highlighting is applied.

Good to know: The code is not compiled or run, and there is no highlighting.

What Java files are used for

  • Android and server applications
  • Coursework and exams
  • Open-source libraries
  • Code review

Tips for working with Java files

  • The file name must match the public class name.
  • Check imports at the top to see which libraries are used.
  • Use an IDE for navigation in larger projects.

Is it private to open a Java file here?

Yes. Drop and Open runs entirely in your browser. When you choose a file, the browser reads it into local memory and displays it. There is no upload, no account, and no server-side copy. You can check this by opening your browser's developer tools, watching the Network tab and dropping a file. Learn more in our guide to client-side and server-side viewers.

Java viewer questions

How do I run a .java file?
Install a JDK and use javac then java, or run java File.java for a single-file program.
What is a .class file?
Compiled bytecode, not readable text.
Is it safe to preview?
Yes, it is displayed as text only.
Is it uploaded?
No.