eclipse配置jmeter源码开发环境

Jmeter

jmeter下载源码

新建Java Project

这里写图片描述

这里写图片描述

然后关闭eclipse

修改.classpath

将该Java项目目录中的.eclipse内容删掉,然后用jmeter源码里的eclipse.classpath内容复制到该文件中

eclipse.classpath

<?xml version="1.0" encoding="UTF-8"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<!--
   This is a sample Eclipse .classpath file, which can be used to help set up the proper .classpath.
   Note that the "con" entry may be different on individual systems, but the other entries
   should generally be the same, unless you attach sources or javadoc to the jars.

   Eclipse seems to use TABS for indenting the entries.
 -->
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="src" output="build/components" path="src/components"/>
    <classpathentry kind="src" output="build/core" path="src/core"/>
    <classpathentry kind="src" output="build/examples" path="src/examples"/>
    <classpathentry kind="src" output="build/functions" path="src/functions"/>
    <classpathentry kind="src" output="build/jorphan" path="src/jorphan"/>
    <classpathentry kind="src" output="build/junit" path="src/junit"/>
    <classpathentry kind="src" output="build/monitor/components" path="src/monitor/components"/>
    <classpathentry kind="src" output="build/monitor/model" path="src/monitor/model"/>
    <classpathentry kind="src" output="build/protocol/ftp" path="src/protocol/ftp"/>
    <classpathentry kind="src" output="build/protocol/http" path="src/protocol/http"/>
    <classpathentry kind="src" output="build/protocol/java" path="src/protocol/java"/>
    <classpathentry kind="src" output="build/protocol/jdbc" path="src/protocol/jdbc"/>
    <classpathentry kind="src" output="build/protocol/jms" path="src/protocol/jms"/>
    <classpathentry kind="src" output="build/protocol/ldap" path="src/protocol/ldap"/>
    <classpathentry kind="src" output="build/protocol/mail" path="src/protocol/mail"/>
    <classpathentry kind="src" output="build/protocol/mongodb" path="src/protocol/mongodb"/>
    <classpathentry kind="src" output="build/protocol/native" path="src/protocol/native"/>
    <classpathentry kind="src" output="build/protocol/tcp" path="src/protocol/tcp"/>
    <classpathentry kind="src" output="build/test" path="test/src"/>
    <classpathentry kind="lib" path="lib/avalon-framework-4.1.4.jar"/>
    <classpathentry kind="lib" path="lib/bsf-2.4.0.jar"/>
    <classpathentry kind="lib" path="lib/bsh-2.0b5.jar"/>
    <classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
    <classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
    <classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
    <classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
    <classpathentry kind="lib" path="lib/commons-jexl-1.1.jar"/>
    <classpathentry kind="lib" path="lib/commons-jexl-2.1.1.jar"/>
    <classpathentry kind="lib" path="lib/commons-lang3-3.4.jar"/>
    <classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
    <classpathentry kind="lib" path="lib/commons-math3-3.5.jar"/>
    <classpathentry kind="lib" path="lib/commons-net-3.3.jar"/>
    <classpathentry kind="lib" path="lib/commons-pool2-2.4.2.jar"/>
    <classpathentry kind="lib" path="lib/dnsjava-2.1.7.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-datasource-2.1.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-instrument-1.0.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-logger-1.1.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-pool-api-2.1.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-pool-impl-2.1.jar"/>
    <classpathentry kind="lib" path="lib/excalibur-pool-instrumented-2.1.jar"/>
    <classpathentry kind="lib" path="lib/geronimo-jms_1.1_spec-1.1.1.jar"/>
    <classpathentry kind="lib" path="lib/htmllexer-2.1.jar"/>
    <classpathentry kind="lib" path="lib/htmlparser-2.1.jar"/>
    <classpathentry kind="lib" path="lib/httpclient-4.2.6.jar"/>
    <classpathentry kind="lib" path="lib/httpcore-4.2.5.jar"/>
    <classpathentry kind="lib" path="lib/httpmime-4.2.6.jar"/>
    <classpathentry kind="lib" path="lib/jcharts-0.7.5.jar"/>
    <classpathentry kind="lib" path="lib/jdom-1.1.3.jar"/>
    <classpathentry kind="lib" path="lib/jodd-core-3.6.6.jar"/>
    <classpathentry kind="lib" path="lib/jodd-lagarto-3.6.6.jar"/>
    <classpathentry kind="lib" path="lib/jodd-log-3.6.6.jar"/>
    <classpathentry kind="lib" path="lib/jsoup-1.8.2.jar"/>
    <classpathentry kind="lib" path="lib/jtidy-r938.jar"/>
    <classpathentry kind="lib" path="lib/junit-4.12.jar"/>
    <classpathentry kind="lib" path="lib/logkit-2.0.jar"/>
    <classpathentry kind="lib" path="lib/mail-1.5.0-b01.jar"/>
    <classpathentry kind="lib" path="lib/mongo-java-driver-2.11.3.jar"/>
    <classpathentry kind="lib" path="lib/oro-2.0.8.jar"/>
    <classpathentry kind="lib" path="lib/rhino-1.7.7.jar"/>
    <classpathentry kind="lib" path="lib/rsyntaxtextarea-2.5.7.jar"/>
    <classpathentry kind="lib" path="lib/serializer-2.7.2.jar"/>
    <classpathentry kind="lib" path="lib/slf4j-api-1.7.12.jar"/>
    <classpathentry kind="lib" path="lib/slf4j-nop-1.7.12.jar"/>
    <classpathentry kind="lib" path="lib/soap-2.3.1.jar"/>
    <classpathentry kind="lib" path="lib/tika-core-1.10.jar"/>
    <classpathentry kind="lib" path="lib/tika-parsers-1.10.jar"/>
    <classpathentry kind="lib" path="lib/xalan-2.7.2.jar"/>
    <classpathentry kind="lib" path="lib/xercesImpl-2.11.0.jar"/>
    <classpathentry kind="lib" path="lib/xml-apis-1.4.01.jar"/>
    <classpathentry kind="lib" path="lib/xmlgraphics-commons-2.0.1.jar"/>
    <classpathentry kind="lib" path="lib/xmlpull-1.1.3.1.jar"/>
    <classpathentry kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>
    <classpathentry kind="lib" path="lib/xstream-1.4.8.jar"/>
    <!-- Needed for build and test -->
    <classpathentry kind="lib" path="lib/api/bcmail-jdk15on-1.49.jar"/>
    <classpathentry kind="lib" path="lib/api/bcprov-jdk15on-1.49.jar"/>
    <classpathentry kind="lib" path="lib/api/bcpkix-jdk15on-1.49.jar"/>
    <classpathentry kind="output" path="build"/>
</classpath>

复制文件到Java Project

将jmeter里的源码文件复制到Java项目中,注意这个地方要删点里面的文件夹binsrc:

复制前

这里写图片描述

复制后

这里写图片描述

下载jar包

在Java项目的根目录下执行ant download_jars:

这里写图片描述

再次打开eclipse

刷新一下我们的Java项目,就会出现添加到目录中的所有文件
这里写图片描述

build项目

这里写图片描述

执行成功后输出如下:
这里写图片描述

如何运行失败或无法运行,在该项目上右键Properties-Builders-New-Ant Builder,配置如下:
这里写图片描述

运行项目

如果你执行到次,恭喜你已经配置好源码环境,但是还不能运行项目,你还需要配置Run Configurations:

这里写图片描述

Main选项卡配置

这里写图片描述

Arguments选项卡配置

这里写图片描述

ClassPath选项卡配置

这里写图片描述

Source选项卡配置

这里写图片描述

现出原形

这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值