- Having NetBeans Java SE installed
- Having maven installed
- On Windows: https://www.mkyong.com/maven/how-to-install-maven-in-windows/
- On Linux:
apt install maven
- Having Java 7 or more installed
- On Windows: https://www.java.com/en/download/
- On Linux:
apt install openjdk-8-jdk
andapt install openjdk-8-jre
-
Create a new project in NetBeans. File>New Project...
Under Maven select, Java Application
Complete the project name and the Group Id, we will be using mvnExample and com.test
-
Click on file called pom.xml and add the following between the two project tags:
<dependencies> <dependency> <groupId>com.github.yannick-mayeur</groupId> <artifactId>org.eclipse.january</artifactId> <version>2.0.2</version> </dependency> </dependencies>
-
Create a new Java class with following code in the the main:
Dataset dataset = DatasetFactory.createFromObject(new double[] { 1,2, 3, 4, 5, 6, 7, 8, 9 }); // Print the output: System.out.println("shape of dataset: " + Arrays.toString(dataset.getShape())); System.out.println("toString of dataset: " + dataset.toString()); System.out.println("toString, with data, of dataset: \n" + dataset.toString(true));
-
Run the code by clicking on the play button and selecting the newly created class.