public class Actions
{
public int init() {
return 0;
}//end of init
public int action() {
HelloWorld.main((String[])null);
return 0;
}//end of action
public int end() {
return 0;
}//end of end
}
【编译后情况】
C:\Program Files\Mercury\LoadRunner\scripts\5\Actions.java:9: cannot access lrapi.HelloWorld
bad class file: c:\program files\mercury\loadrunner\classes\lrapi\HelloWorld.class
class file contains wrong class: HelloWorld
Please remove or make sure it appears in the correct subdirectory of the classpath.
import lrapi.HelloWorld;
^
1 error
【说明】我已经将HelloWorld.class拷贝放入lrapi目录下了,不过为什么还是报class file contains wrong class??作者: shiwanli 时间: 2009-9-6 10:18 标题: 补充 【class文件】将HelloWorld.class拷贝放入C:\j2sdk1.4.2_07\lib目录下,编译提示
C:\Program Files\Mercury\LoadRunner\scripts\5\Actions.java:9: cannot access lrapi.HelloWorld
bad class file: c:\program files\mercury\loadrunner\classes\lrapi\HelloWorld.class
class file contains wrong class: HelloWorld
Please remove or make sure it appears in the correct subdirectory of the classpath.
import lrapi.HelloWorld;
^
1 error作者: shiwanli 时间: 2009-9-6 10:48 标题: 补充 【runtime设置】中已经将c:\program files\mercury\loadrunner\classes\lrapi\HelloWorld.class加了进去了。还是报同样的错误作者: lijian422202 时间: 2009-9-7 10:11
你把class放到lrapi目录下。。但你的helloworld.class编译前的java文件中加了package吗 ?作者: xxicy 时间: 2009-9-7 11:04
【说明】我已经将HelloWorld.class拷贝放入lrapi目录下了,
【class文件】将HelloWorld.class拷贝放入C:\j2sdk1.4.2_07\lib目录下,