1、就是下面这个最简单初始化的JAVA脚本程序,从编译到运行都有问题
import lrapi.lr; public class Actions { public int init() throws Throwable { return 0; }//end of init public int action() throws Throwable { System.out.println("hello world"); return 0; }//end of action public int end() throws Throwable { return 0; }//end of end }
因为loadrunner11最高支持的jdk1.6版本,在安装之前,本人已安装过1.7版本,本认为更新一下环境变量把java_home的jdk1.7更改为1.6的路径去掉即可,但在运行时,loadrunner一直找到的是1.7版本,下面显示的path记录又是1.6版本,按照网上各种方法无法解决,最后只能将1.7版本卸载干净,没有了这个错误,其中还有以下这个错误
Error: at java.lang.ClassLoader.defineClass1(Native Method)
loadrunner Can't create script object.
总而言之,把高版本卸载干净,然后安装支持的版本,环境变量一定要配置好(切记),最后记得把loadrunner一定要重启才可生效。