如何解决此错误线程中的异常" main" java.lang.NoClassDefFoundError:javax / crypto / SecretKey
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.RefreshHandler;
import java.io.IOException;
import java.net.URL;
public class veriçekmek {
public static void main(String[] args) throws Exception {
WebClient web=new WebClient();
HtmlPage sayfa=web.getPage("http://www.idefix.com");
当我运行此程序时,我收到类似这样的错误
Exception in thread "main" java.lang.NoClassDefFoundError: javax/crypto/SecretKey
答案 0 :(得分:0)
javax.crypto包包含在 jce.jar 中,可以在JRE的“lib”文件夹下找到。 将它添加到你的类路径中,你应该没问题。
有关classpath的更多信息,请参阅: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html