-3

I have been developing a java project where I need to create a ssh tunnel. I am using chilkat library for the purpose.I have installed it successfully in my project folder. Here is the code snippet. But I am getting an error saying:

import com.chilkatsoft.* not resolved .

The code is:

package usingchilkat;

import com.chilkatsoft.*;

public class myclass {
static {
       try{
           System.loadLibrary("chilkat");
       ``  } catch (UnsatisfiedLinkError e) {
            System.err.println("Native code library failed to load.\n" + e);
            System.exit(1);
          }
        }

        public static void main(String argv[])
        {
        //  Important: It is helpful to send the contents of the
        //  ssh.LastErrorText property when requesting support.

            CkSshUnnel ssh = new CkSsh();
            boolean success = ssh.UnlockComponent("Anything");
            if (success != true) {
              System.out.println(ssh.lastErrorText());
              return;}
           }

Can anyone please help me fix it?

kenorb
  • 155,785
  • 88
  • 678
  • 743
Ankita Saha
  • 137
  • 3
  • 10

1 Answers1

2

Have you correctly set your java.library.path system property? Like:

java -Djava.library.path=yourPath yourApp

Or simply load all the path directly:

System.load("c:/yourPath/chilkat.dll");
Matteo Baldi
  • 5,613
  • 10
  • 39
  • 51
  • I have selected project->properties->java build path->add external jar and added the chilkat.jar . Next In Edit configuration I added Djava.library.path=”C:\chilkatJava;${env_var:PATH}” to the Arguments tab. – Ankita Saha Nov 08 '16 at 14:40