7.2. Create a Main Method in the Quickstart Class
Create a new Quickstart class by following the outlined steps:
Procedure 7.1. Create a Main Method in the Quickstart Class
Create the Quickstart.java File
Create a file calledQuickstart.java
at your project's location.Add the Quickstart Class
Add the following class and method:import org.infinispan.manager.DefaultCacheManager import org.infinispan.Cache package com.mycompany.app; public class Quickstart { public static void main(String args[]) throws Exception { Cache<Object, Object> c = new DefaultCacheManager().getCache(); } }
Copy Dependencies and Compile Java Classes
Use the following command to copy all project dependencies to a directory and compile the java classes from our project:$ mvn clean compile dependency:copy-dependencies -DstripVersion
Run the Main Method
Use the following command to run the main method:$ java -cp target/classes/:target/dependency/* com.mycompany.app.Quickstart