| 
									
										
										
										
											2011-11-10 20:44:09 +08:00
										 |  |  |    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. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-06-10 22:09:15 +08:00
										 |  |  | Eclipse settings | 
					
						
							|  |  |  | ---------------- | 
					
						
							|  |  |  | The following files should be excluded from build output: | 
					
						
							|  |  |  | *.metaprops | 
					
						
							|  |  |  | See Preferences/Java/Building/Output Folder/Filtered Resources | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-08 08:48:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-12-30 09:07:33 +08:00
										 |  |  | Eclipse.classpath | 
					
						
							|  |  |  | ----------------- | 
					
						
							| 
									
										
										
										
											2014-12-28 22:34:15 +08:00
										 |  |  | [This has been tested with Eclipse 3.2 up to 4.3.2. It may not work with other versions.] | 
					
						
							| 
									
										
										
										
											2003-12-30 09:07:33 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | The file eclipse.classpath is intended as a starter .classpath file  | 
					
						
							| 
									
										
										
										
											2014-12-28 22:34:15 +08:00
										 |  |  | for building JMeter using Eclipse version 3 to 4.3.  Make sure to execute | 
					
						
							|  |  |  | the "ant download_jars" task to download and install the jars referred | 
					
						
							|  |  |  | to in the classpath before creating the Eclipse project.  | 
					
						
							|  |  |  | If you do after creating project, then don't forget to refresh Eclipse project.  | 
					
						
							| 
									
										
										
										
											2003-12-30 09:07:33 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-28 22:34:15 +08:00
										 |  |  | Note that Eclipse is not easy to use for creating jar files. | 
					
						
							| 
									
										
										
										
											2003-12-30 09:07:33 +08:00
										 |  |  | However, it is easy to use Eclipse to run Ant. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The following targets may prove useful: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-28 22:34:15 +08:00
										 |  |  |   clean - Clean up to force a build from source | 
					
						
							| 
									
										
										
										
											2007-03-08 08:48:47 +08:00
										 |  |  |   package-only - creates the jars | 
					
						
							|  |  |  |   package - compiles everything and then packages it | 
					
						
							| 
									
										
										
										
											2007-09-15 17:22:58 +08:00
										 |  |  |   run_gui - compiles, packages, and then start the JMeter GUI from the jars | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Invoking Ant targets inside Eclipse | 
					
						
							|  |  |  | ---------------------------------- | 
					
						
							|  |  |  | You can use the "Run As --> Ant Build" and select target, or you can use | 
					
						
							|  |  |  | the "Windows->Show View->Ant View". Then select the "build.xml" file and | 
					
						
							|  |  |  | drag and drop to the "Ant View". | 
					
						
							|  |  |  | Now you can invoke targets by clicking on them. | 
					
						
							|  |  |  | Note that if you invoke for example the "compile" target, and get error | 
					
						
							|  |  |  | messages about  | 
					
						
							|  |  |  | " | 
					
						
							|  |  |  | Unable to find a javac compiler; | 
					
						
							|  |  |  | com.sun.tools.javac.Main is not on the classpath. | 
					
						
							|  |  |  | Perhaps JAVA_HOME does not point to the JDK | 
					
						
							|  |  |  | " | 
					
						
							|  |  |  | it just means that your Eclipse project is set up with JRE libraries instead of JDK libraries. | 
					
						
							|  |  |  | The suggested fix is to add a JDK in "Window->Preferences->Java->Installed JREs". | 
					
						
							|  |  |  | Then do a "Project->Properties" and select "Java Build Path" in the left pane, and then | 
					
						
							|  |  |  | select the "Libraries" tab in the right pane. Scroll to the bottom, select the "JRE System Library", | 
					
						
							|  |  |  | and click "Remove". Then click "Add library..." , select "JRE System Library", and then select | 
					
						
							|  |  |  | the JDK. Now it should work when you invoke the "compile" target. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-08 08:48:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-10 03:55:18 +08:00
										 |  |  | Finishing the build using Ant | 
					
						
							|  |  |  | ----------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Find the build.xml file in the project,  | 
					
						
							|  |  |  | right click on it, and click "Run As --> Ant Build". | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Make sure you select the "package" target. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-28 22:34:15 +08:00
										 |  |  | This will compile any remaining classes, | 
					
						
							| 
									
										
										
										
											2007-03-10 03:55:18 +08:00
										 |  |  | and then create all the jars. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Now refresh the project (you should add this to the Ant build properties) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-08 08:48:47 +08:00
										 |  |  | Launching from Eclipse | 
					
						
							|  |  |  | ---------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-15 17:22:58 +08:00
										 |  |  | You can use the Ant target run_gui to run the JMeter GUI, or you can follow the instructions | 
					
						
							|  |  |  | below to add a Java Application launch, which will for example, allow you to use the debugger to | 
					
						
							|  |  |  | run JMeter. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-01 18:57:26 +08:00
										 |  |  | These instructions assume you have configured Eclipse to use the classpath | 
					
						
							|  |  |  | as suggested in eclipse.classpath, and have run "ant package" to compile | 
					
						
							|  |  |  | the RMI classes and build the jars. | 
					
						
							| 
									
										
										
										
											2007-03-08 08:48:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-10 03:55:18 +08:00
										 |  |  | Create a new Java Application launch configuration. | 
					
						
							| 
									
										
										
										
											2007-03-08 08:48:47 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | On the Main tab, enter the following as the main class: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   org.apache.jmeter.NewDriver | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  | On the Arguments tab, in the Working Directory area, pick the radio | 
					
						
							|  |  |  | button next to "Other" and enter the following in the text box: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-01 21:49:53 +08:00
										 |  |  |   ${workspace_loc}/jmeterproject/bin | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  |  where "jmeterproject" is the name of the JMeter project. | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |  [It would be nicer to use ${project_loc}/bin  | 
					
						
							| 
									
										
										
										
											2010-11-27 20:17:14 +08:00
										 |  |  |  but unfortunately the Eclipse Debug view does not seem to preserve any of the project variables] |