.java Java source code
Text & source code
| MIME type | text/x-java |
|---|---|
| Description | Java source code |
| Category | Text & source code |
| Based on | text/x-csrc |
Frequently asked questions
What is a .java file?
A .java file is a “Java source code” (MIME type text/x-java).
How do I open a .java file?
With any text editor – Notepad++, Visual Studio Code, or gedit and vim on Linux. The file contains readable text, possibly source code or configuration.
How can you tell a genuine .java file?
No fixed signature at the start of the file is registered for this format; it is recognised mainly by its extension. On Linux and macOS, file --mime-type example.java shows the guessed type.
Which format is .java based on?
Technically a .java file is a subtype of “C source code” (text/x-csrc), so programs for that base format can often read it too.
Which MIME type belongs to .java?
The MIME type is text/x-java. In the Apache web server: AddType text/x-java .java; in nginx: types { text/x-java java; }.