Java
In order to use the library you need to install Java Platform (JDK) version 8 or higher. You can verify this by entering the following command into a terminal:
java -version
# Example output:
# java version "1.8.0_211"
# Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
# Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
To use the library, the command above must output version 1.8.0
or higher.
There are several IDEs that can be used to create a Maven project which the Zaber library can be added to. The below instructions cover IntelliJ IDEA specifically.
If you are not using IntelliJ IDEA for development, download and install Apache Maven (IntelliJ IDEA already includes Maven.) You can verify installation by entering the following command into a terminal:
mvn -v
# Example output:
# Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T12:00:29-07:00)
# Maven home: C:\Program Files\apache-maven-3.6.1
# Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_211\jre
# Default locale: en_US, platform encoding: Cp1252
# OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
IntelliJ IDEA
IntelliJ IDEA runs on Windows, macOS and Linux. You can download the free IntelliJ IDEA Community Edition here.
In IntelliJ IDEA, follow these steps:
- Click Create New Project on the Welcome screen, or select File > New > Project from the main menu.
- Select Maven from the options on the left.
- Specify the Project SDK (make sure the version is 8 or higher).
- Check Create from archetype and select maven-archetype-quickstart then click Next.
- Specify the basic project information (GroupId, ArtifactId, and Version) that will be added to the project's
pom.xml
then click Next. You may, for example, enter these values:com.test
(GroupId),sample1
(ArtifactId),1.0-SNAPSHOT
(Version). - Optionally change the default Maven home directory and Maven repositories then click Next.
- Optionally change the default name and location of the project then click Finish.
- A new project should open. Wait until IDEA fully loads the project.
- Click on the
pom.xml
file located in the root folder and add the library into the<dependencies>
xml tag:
<dependency>
<groupId>com.zaber</groupId>
<artifactId>motion-library</artifactId>
<version>3.2.0</version>
</dependency>
- There will be a file named
App.java
in src > main > java > yourProjectName (when yourProjectName is the name you specified). Edit the file to start writing code.
Continue the Getting Started guide by running the example code.
Continue the Getting Started guide by initializing the library in your code.
Troubleshooting
If the mvn
command fails to execute, make sure that the JAVA_HOME
environment variable is set to point to your JDK installation.
Updating
If you are already using the library and want to update to the latest version, change the version of Motion Library plugin to the latest version in the pom.xml
located in your project folder:
<dependency>
<groupId>com.zaber</groupId>
<artifactId>motion-library</artifactId>
<version>3.2.0</version>
</dependency>
Then build your project to download the new dependency to your Maven repository.