Skip to content

Getting started

nero edited this page Jan 21, 2019 · 4 revisions

Import the engine

Using .jar

Download the .jar from the github release page. Then import it to your project as an external library.

Using maven

Add these lines to maven:

<dependency>
    <groupId>io.github.n3roo</groupId>
    <artifactId>nero-engine</artifactId>
    <version>**Engine still not released**</version>
</dependency>

Start the engine

To start the engine you only need one line of code. Then you can use everything you want with the engine.

public static void main(String[] args){
    NeroEngine.start();
    // Your code
}

Logger

If you want to log, you should use the log4j2 logger since the engine already uses this one, and it is already configurated. To use it you need to add these lines to maven:

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.11.1</version>
</dependency>
<dependency>
     <groupId>org.apache.logging.log4j</groupId>
     <artifactId>log4j-core</artifactId>
      <version>2.11.1</version>
</dependency>

Then, you need to use:

private static final Logger LOGGER = LogManager.getLogger(NeroEngine.class.getName());

private void foo(){
    LOGGER.info("some info");
    LOGGER.warn("some warning");
    // and so on
}
Clone this wiki locally