问题:完成了升级鸿蒙OS的过程,在配置完证书后,真机运行提示失败,出现线程“main”中的异常:Exception in thread "main" java.lang.NoClassDefFoundError: sun/security/util/ConstraintsParameters。
问题追加: Exception in thread "main" java.lang.NoClassDefFoundError: sun/security/util/ConstraintsParameters at com.huawei.signclient.hap.ext.SignerInfoExt.verifyPss(SignerInfoExt.java:118) at com.huawei.signclient.hap.ext.PKCS7Ext.verifyPss(PKCS7Ext.java:79) at com.huawei.signclient.hap.ext.PKCS7Ext.verify(PKCS7Ext.java:55) at com.huawei.signclient.hap.sign.SignHapV2.packagePKCS7(SignHapV2.java:584) at com.huawei.signclient.hap.sign.SignHapV2.generateSignerBlock(SignHapV2.java:519) at com.huawei.signclient.hap.sign.SignHapV2.generateHapSignatureSchemeV2Block(SignHapV2.java:475) at com.huawei.signclient.hap.sign.SignHapV2.generateHapSigningBlock(SignHapV2.java:377) at com.huawei.signclient.hap.sign.SignHapV2.getHapSigningBlock(SignHapV2.java:276) at com.huawei.signclient.hap.sign.SignHapV2.sign(SignHapV2.java:241) at com.huawei.signclient.hap.provider.SignProvider.sign(SignProvider.java:343) at com.huawei.signclient.hap.signtool.HapSignTool.sign(HapSignTool.java:145) at com.huawei.signclient.hap.signtool.HapSignTool.processCmd(HapSignTool.java:70) at com.huawei.signclient.hap.signtool.HapSignTool.main(HapSignTool.java:57) Caused by: java.lang.ClassNotFoundException: sun.security.util.ConstraintsParameters at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 注:Java环境:1.8.0——141。
回答: 更换jdk为deveco自带的就可以解决问题了。 注:deveco全称是HUAWEI DevEco Studio。 |