Installing the API (including how to uninstall)

Lee Painter

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 simply involves adding the jar files you need to your programs classpath. How this is achieved can vary depending on whether you are using a dependency management system like Maven, or if you are just creating a simple project in Eclipse or other IDE.

 

Using the Maven Dependency

Most users will find it very convenient to use our Maven dependency from Maven Central. There are a number of dependencies available to you and 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 then just edit your pom.xml and insert the following dependency:

   <dependency>
      <groupId>com.sshtools</groupId>
       <artifactId>maverick-synergy-client</artifactId>
       <version>3.0.0-SNAPSHOT</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.0.0-SNAPSHOT</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 are combining both the client and server APIs in the same program then 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 then 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.0.0-SNAPSHOT.jar;<other dependencies> <your main class>

If you need to uninstall this dependency simply stop using it in the classpath and delete the zip extracted files and 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, simply reverse this operation and remove the selected jar file from the Classpath entries. Ensuring you also delete the zip extracted files and the zip file from your computer.