# 1.6. (Optional) Compiling Osmose-Java¶

The compilation of Osmose-Java is not necessary to run Osmose, since Java excutables are provided in the package. However, if the user wants to edit and recompile the Osmose-Java core, instructions are provided below.

## 1.6.1. Netbeans (Osmose <= 4.2.0)¶

Up to version 4.2.2, the only way to compile the Osmose Java core is by using the integrated development environment (IDE) Netbeans (https://netbeans.org/downloads/)

Note

The modification of the Java code is done as follows:

• Unzip one of the .zip file of the osmose/java directory

• Open Netbeans

• Click on Open a project

• Select the folder that has been extracted (should have a coffee cup icon)

• Edit the code

• Clean and build the project by pressing Maj + F11

This new .jar file can be used in the run_osmose function of the Osmose R package.

## 1.6.2. Maven (Osmose >= 4.3.0)¶

From version 4.3.0, the code can be compiled independently of the Netbeans IDE by using the Apache Maven software project management and comprehension tool (https://maven.apache.org/index.html). When Maven is installed:

• Unzip one of the .zip file of the osmose/java directory

• Navigate to the directory via the Terminal (Linux/Mac) or Cmd (Windows) panel.

• Type mvn install

The sources will be built in the target directory.

Note

Maven projects can also be built with Netbeans, Eclipse or Visual Studio