Java Development Environment
This section explains how to set up a Java development environment to employ this client.
Supported Java Versions
The supported Java versions are as follows:
Product | Versions |
---|---|
Java | 11, 17, 21 |
Note
For server-side deployments, Java 17 is the supported version.
Adding Maven Dependencies for Java Development
You need to add the following Maven <dependency>
section in your pom.xml file, which will add all the .jars to your application to successfully setup the Java development environment.
- For NCache Enterprise:
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-client</artifactId>
<version>x.x.x</version>
</dependency>
- For NCache Professional:
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-professional-client</artifactId>
<version>x.x.x</version>
</dependency>
You can also add Maven Dependencies for the following Java Integrations:
Java Web Sessions
- For Tomcat version 10 or less.
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-javax-sessions</artifactId>
<version>x.x.x</version>
</dependency>
- For Tomcat version 10+.
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-sessions</artifactId>
<version>x.x.x</version>
</dependency>
Hibernate
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-hibernate</artifactId>
<version>x.x.x</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>x.x.x</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>x.x.x</version>
</dependency>
Spring
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-spring</artifactId>
<version>x.x.x</version>
</dependency>
JCache
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-client</artifactId>
<version>x.x.x</version>
</dependency>
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-professional-client</artifactId>
<version>x.x.x</version>
</dependency>
Specifying Packages for Java
While setting up the Java development environment you also need to import the given package in your application to get started with: import com.alachisoft.ncache.client.*;
Note
The Maven packages provided by NCache does not include client.ncconf and config.ncconf files. To configure your caches, you have to manually create these files as per your need. You can find the snippet of these files as well as their details in our Administrator's Guide: Client Config and Cache Config.