【发布时间】:2017-08-22 08:27:48
【问题描述】:
这里已经有人问过这个问题:"The method setConfig(Properties) in the type Session is not applicable for the arguments (String, String)" 一年多以前,但它没有任何答案,我现在也有同样的问题。
很遗憾,我在 Google 上没有找到更多内容。
import com.jcraft.jsch.*;
import java.io.*;
import java.util.Properties
JSch jsch = new JSch();
String user = "myUserId";
String host = "myHost";
Session session = jsch.getSession(user, host, 22);
session.setConfig("StrictHostKeyChecking", "no");
我的代码就是这么简单,我收到以下消息:
类型Session中的setConfig(Properties)方法不是 适用于参数(字符串,字符串)。
所以我尝试了另一种方法来做同样的事情,但它不起作用是不正常的。有谁知道问题出在哪里?
【问题讨论】: