how do I solve this error Exception in thread "main" java.lang.NoClassDefFoundError: javax/crypto/SecretKey

how do I solve this error Exception in thread "main" java.lang.NoClassDefFoundError: javax/crypto/SecretKey

如何解决线程 "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

javax.crypto 包包含在 jce.jar 中,可以在 JRE 的 "lib" 文件夹下找到。 将它添加到您的类路径中,您应该没问题。

有关类路径的详细信息,请参阅: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html

我通过安装来自 https://jdk.java.net 的新参考 jdk 解决了这个问题。

无论出于何种原因,这些构建包括 oracle 构建中缺少的加密 jar。