jmeter 二次开发小记

1、 ant -- 解决运行时报“Class not found: javac1.8”的问题
解决:这是eclipse的编译环境与项目的要求不对应造成的,这个错误一般是导入别的项目才出现的。右键项目--属性--勾选Enable project  specific  settings--Compiler compliance level--选择1.7--OK
解决办法:
1. 进入window / preferences / java / Installed JREs 
1)Add 
2)输入JRE Name, JDK1.5.0.09
3)JRE home directory, 选择安装的路径 
4)OK 
2. 进入Project / properties / Java Bulid Path 
1)Add library 
2)JRE System Library后按Next 
3)workplace default JRE后按 finish... 
Error
Thu Mar 08 14:20:38 CST 2018
Cannot install remote marketplace locations: Connection failed
This is most often caused by a problem with your internet connection. Please check your internet connection and retry.
org.eclipse.core.runtime.CoreException: Unable to read repository at http://marketplace.eclipse.org/catalogs/api/p.

解决:升级Ant,升级后版本为1.9.4

2、'<>' operator is not allowed for source level below 1.7

jmeter 二次开发小记


3、_p cannot be resolved to a variable ->

解决:因为->是只有java8才有的,必须导入一个java8支持插件,叫Java 8 Kepler,详细步骤参考https://jingyan.baidu.com/article/d169e186a8532a436611d8a7.html

4、The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build pat

解决:出现以上错误的原因是居然是装jdk5时了多装了个jre。本来Eclipse在建立项目时,会自动参照你的jre路径,但多个版本就没办法加载了。 

这样就行了。

5、 at

解决:解决方案是修改eclipse.ini,然后重启eclipse -vmargs-Xmx512m...-Djava.net.preferIPv4Stack=true

6、运行的报错提示项目路径bin下没有log4j2.xml文件

解决:去可运行的jmeter路径bin下将log4j2.xml这个文件复制过来就好了