-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?

2
  • Have you tried import com.chilkat.*; ? Commented Nov 8, 2016 at 14:50
  • Yes. But it shows the same error. Commented Nov 8, 2016 at 14:52

1 Answer 1

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");
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.