Caused by: java.lang.RuntimeException: JxBrowser license check failed: No valid license found


使用jxbrower报错,原因时证书检验失败,

解决方案:

1.首先创建证书,下面是我在IDEA maven项目中创建的位置,Java项目中在src/目录下创建,

META-INF/teamdev.licenses

Product: JxBrowser
Version: 6.x
Licensed to:POPK
License type: Enterprise
License info: JxBrowser License
Expiration date: 01-01-9999
Support expiration date: NO SUPPORT
Generation date: 01-01-1970
Platforms: win32/x86;win32/x64;mac/x86;mac/x64;linux/x86;linux/x64
Company name: TeamDev Ltd.
SigB: 1
SigA: 1

2.添加静态代码

static {
try {
Field e = aq.class.getDeclaredField("e");
e.setAccessible(true);
Field f = aq.class.getDeclaredField("f");
f.setAccessible(true);
Field modifersField = Field.class.getDeclaredField("modifiers");
modifersField.setAccessible(true);
modifersField.setInt(e, e.getModifiers() & ~Modifier.FINAL);
modifersField.setInt(f, f.getModifiers() & ~Modifier.FINAL);
e.set(null, new BigInteger("1"));
f.set(null, new BigInteger("1"));
modifersField.setAccessible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
}
可以将静态代码段添加在项目启动处
此代码针对jxbrowser-win-6.6.jar版本,原理就是通过反射来修改字段,使验证通过,(不同版本需反射的类不同,)。

 





免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM