本文介绍了收到“无法解析为类型"在iReport中使用静态方法进行表达的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Java程序,并为该程序创建了jar文件,其程序类名称为DateFormate,静态方法为demo()

I created one Java program and create jar file for that program in the program class name is DateFormate and static method is demo()

然后将那个jar文件添加到iReport文件中,然后我将该 static 方法称为

Then added that jar file to iReport file then i call that static method as

new com.it.DateFormate.demo()

然后出现此错误:

com.it.DateFormate cannot be resolved to a type

推荐答案

如果是静态方法,则调用将为

If it is a static method the call will be

com.it.DateFormate.demo()

因此,没有

要使其正常工作,必须将类放在classpath中,如果您希望它在IDE内工作,请确保添加一个包含该类的jar(到IDE).

To make it work the class needs to be in classpath, if you like it to work inside of your IDE make sure you add a jar (to the IDE) that contains this class.

这篇关于收到“无法解析为类型"在iReport中使用静态方法进行表达的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 08:24