> For the complete documentation index, see [llms.txt](https://educacion.gitbook.io/programacion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://educacion.gitbook.io/programacion/ud1-introduccion-a-programacion/introducion-a-java/o-funcionamento-de-java.md).

# O funcionamento de Java

O código fonte dos nosos programas en Java, vaise escribir en un ou varios ficherios **.java.** Mais tarde este código vai ser compilado xerando un ficheiro **.class** que vay conter os **BYTECODE JAVA**

O **BYTECODE** vai a ser interpretado pola **máquina virtual** **JAVA,** mediante un **compilador JIT** que proporciona o **código máquina**. Este código máquina vai a ser executado polos compoñentes Hardware da máquina de destino.

<figure><img src="/files/14tUbFbHc8bhd8E30L02" alt=""><figcaption></figcaption></figure>

Ese ficheiro .class en **BYTECODE** é exactamente o mesmo, independentemente da plataforma. A **máquina virtual Java (JVM)** interpreta este bytecode para convertilo a **linguaxe máquina**. Lembra que os fabricantes utilizan distintos linguaxes máquina.

<figure><img src="/files/ecKwjaAJtYDbtZ7HUZkn" alt=""><figcaption></figcaption></figure>

## Esquema de compilación e execución en Java

<figure><img src="/files/nV3BTNuD0w3sfbt5Djwm" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://educacion.gitbook.io/programacion/ud1-introduccion-a-programacion/introducion-a-java/o-funcionamento-de-java.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
