简体   繁体   English

java lang 验证错误

[英]java lang verify error

java.lang.VerifyError: (class: a method: parse signature: 
()Z) Incompatible argument to function

public boolean parse() {


}

What does this error mean and how to fix these kind of errors此错误是什么意思以及如何修复此类错误

Normally this kind of error is related to version problems, you are compiling with a different version of a library than you are running with.通常这种错误与版本问题有关,您正在使用与正在运行的不同版本的库进行编译。 There are also some quite subtle varieties of this that can occur with java 1.5 type coercion, where a 1.4 compiler would choose differently. java 1.5 类型强制转换也可能会出现一些非常微妙的变化,其中 1.4 编译器会选择不同的类型。 Recompile everything with 1.5, and make sure you're using the same versions.使用 1.5 重新编译所有内容,并确保使用相同的版本。

It usually is about a java 1.5 or 6 compatibility issue (like trying to compile a Java5 or 6 code with an older 1.4 javac).它通常是关于 java 1.5 或 6 兼容性问题(例如尝试使用较旧的 1.4 javac 编译 Java5 或 6 代码)。

Clean all your.class files and rebuild from scratch, checking that you have your JDK and JRE at the same level.清理所有 .class 文件并从头开始重建,检查您的 JDK 和 JRE 是否处于同一级别。


It can also be a bad typecast from a third party class method "return items" to your local ones.它也可能是来自第三方 class 方法的错误类型转换“返回项目”给您当地的。

I just found this:我刚发现这个:

Thrown when the "verifier" detects that a class file, though well formed, contains some sort of internal inconsistency or security problem.当“验证程序”检测到 class 文件虽然格式正确,但包含某种内部不一致或安全问题时抛出。 Java API Java API

Have you returned a boolean?您是否退回了 boolean?

Could you please provide more information, which environment is set?您能否提供更多信息,设置了哪个环境? The security question is important, I think.我认为安全问题很重要。

well, first seems to be that the returning value is missong.好吧,首先似乎是返回值是missong。 You should return a boolean value.您应该返回 boolean 值。 But this is not the problem.但这不是问题。 This kind of exception appears when you make a reference which cannot be resolved, like an assignement in a loop当您进行无法解析的引用时会出现这种异常,例如循环中的分配

for (i=i; i;=XX;i++)对于 (i=i;i;=XX;i++)

check such references.检查这些参考。

Luis路易斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM