# Maven

## Introduction

TotalCross uses Maven to automate compilation, being quick and easy to use.

> *"Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information."*

This article targets users of Visual Studio Code and other IDEs that do not have Maven integration.

## Guide

{% tabs %}
{% tab title="Windows" %}
Next steps requires *administrator* privileges.

**Step 1:** go to [**link**](http://maven.apache.org/download.cgi). Download the latest Maven .zip:

![](/files/-M26QmBJGquIwaeReROy)

**Step 2:** unzip into *C:/Program Files/Maven/* (recommended);

**Step 3:** open CMD (command line prompt) as administrator;

**Step 4:** set *MAVEN\_HOME* environment variable:

`C:\> setx MAVEN_HOME "C:\Program Files\Maven\apache-maven-3.6.3"`

**Step 5:** add *MAVEN\_HOME* and bin subfolder to PATH :

`C:\> setx PATH "%MAVEN_HOME%;%MAVEN_HOME%\bin;%PATH%;"`

**Step 6:** reopen  your CMD (command line prompt) and try:

`C:\> mvn -version`

if response is `Apache Maven 3.6.3` you installed everything correctly.
{% endtab %}

{% tab title="macOS X" %}
Install brew, it is pretty easy and straightforward. Paste the following command on your terminal.

```
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

Brew is a package manager that easily allows you to install packages on macOS X, it is similar to the debian package manager apt-get. Paste the command bellow on you terminal and you will have the Java JDK 8 on your machine.

```
brew install maven 
```

{% endtab %}

{% tab title="Linux (Debian based)" %}
Next steps requires *sudo* privileges.

**Step 1:** open terminal (CTRL+ALT+T);

**Step 2:** update APT:

`$ sudo apt-get update`

**Step 3:** install Maven:

`$ sudo apt-get -y install maven`

**Step  4:** check installation:

`$ mvn -version`

{% hint style="info" %}
TotalCross needs Maven 3.6.X or later
{% endhint %}
{% endtab %}
{% endtabs %}

## See more

With these requirements, it's possible to [start](https://totalcross.gitbook.io/playbook/learn-totalcross/getting-started) with TotalCross!


---

# Agent Instructions: 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://learn.totalcross.com/documentation/miscelaneous/maven.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.
