Installing the API (including how to uninstall)

This article explains how to install the Maverick Synergy Java SSH API in your development environment. 

Maverick Synergy is distributed as a set of Java .jar files, and as such, this involves adding the jar files you need to your program’s classpath. How this is achieved can vary depending on whether you are using a dependency management system like Maven or creating a simple project in Eclipse or another IDE.

Using the Maven Dependency

Most users will find using our Maven dependency from Maven Central very convenient. Several dependencies are available; you should only select those appropriate for your usage. 

For example, to install the SSH API in your environment to use as an SSH client, just edit your pom.xml and insert the following dependency:

   <dependency>
      <groupId>com.sshtools</groupId>
       <artifactId>maverick-synergy-client</artifactId>
       <version>3.1.0</version>
   </dependency>

If you are implementing an SSH server, then you should use the following dependency:

   <dependency>
      <groupId>com.sshtools</groupId>
       <artifactId>maverick-synergy-server</artifactId>
       <version>3.1.0</version>
   </dependency>

If you are using a SNAPSHOT version, you must also specify the following repository in your pom.xml

   <repository>
      <id>oss-snapshots</id>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
   </repository>

This will install the core Maverick Synergy jar files in your Maven repository the next time you perform a build. 

If you combine the client and server APIs in the same program, please ensure you use the same version for both dependencies.

Uninstall

If you need to uninstall this dependency at any time in the future, remove the dependency block above from your pom.xml. If you want to ensure that the .jar files are also removed from your Maven repository, you should manually delete these by deleting the files and folders under ~/.m2/repository/com/sshtools.

Installing to the Classpath

If you are building a program and managing the classpath yourself, then you should download and unzip the maverick-synergy-bin-<version>.zip from our website, extract the zip file and then, depending on whether you need to use an SSH client or implement an SSH server include the path to the maverick-synergy-client-<version>.jar or maverick-synergy-server-<version>.jar  in your classpath. 

To use this on the command line, execute your Java compiler and program with the -cp option, including our jar file in your list of dependencies.

java.exe -cp maverick-synergy-client-3.1.0.jar;<other dependencies> <your main class>

If you need to uninstall this dependency, stop using it in the classpath and delete the zip extracted files and the zip file itself. 

Using Eclipse

Download and unzip the maverick-synergy-bin-<version>.zip from our website. Then, within Eclipse, right-click on your Java project and select properties from the menu.

This will show you the project settings, then select Java Build Path in the left-hand column.

Now add the maverick-synergy-client-<version>.jar or maverick-synergy-server-<version>.jar file to your classpath by clicking on the Add External JARs button, navigating to the extracted zip and selecting the jar file required.

The jar file will now be installed in your Classpath.

Uninstall

To uninstall this, reverse this operation and remove the selected jar file from the Classpath entries. Ensure you also delete the zip extracted and zip files from your computer.