JSch不包含在jdk 1.7中吗? [英] JSch is not included in jdk 1.7?
问题描述
我试图使用JSch通过ssh连接到mysql.根据JSch网站的介绍, http://www.jcraft.com/jsch/它应与j2se一起使用1.4及更高版本,无需其他库".我安装了jdk 1.7.但是如何得到错误消息:包com.jcraft.jsch包不存在,请导入com.jcraft.jsch.JSch;".当我编译我的Java代码时.我想知道如何使其工作.
I was trying to use JSch to connect to a mysql via ssh. According to JSch website, http://www.jcraft.com/jsch/ it should work with j2se 1.4 and up, "no additional libraries required". I have jdk 1.7 installed. Howver got the error saying "package com.jcraft.jsch does not exist, import com.jcraft.jsch.JSch;" when I compiled my java code. I wonder how to get it to work.
推荐答案
在应用程序"lib"文件夹中添加JSch JAR.
Add the JSch JAR in the application "lib" folder.
或使用JSch.JAR更新系统类路径
Or update your system class path with JSch.JAR
在Windows中
转到
Advance System settings --> Advanced (tab) --> Environment Variables --> User Variables
添加
CLASSPATH = %CLASSPATH%;C:\LOCATION OF THE JAR\JSch.jar
这篇关于JSch不包含在jdk 1.7中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!