Skip to main content

Which language is used in JMeter?

Which language is used in JMeter?

Key takeaways

  • Apache JMeter is written in Java. Its manual calls it “a 100% Java application”, so it needs Java 8 or higher to run.
  • Test plans are saved as .jmx files, which are XML. You normally build them in the GUI and never write that XML by hand.
  • You need no programming language for most tests. When you do need code, use a JSR223 element with Groovy, which the JMeter manual recommends over BeanShell.

Apache JMeter is written in Java, and Java is the language you need to know if you want to extend JMeter itself. To build and run ordinary load tests you need no programming language at all: you assemble a test plan from built-in elements in the GUI. When a test needs custom logic, you script it inside the plan with Groovy through a JSR223 element.

What programming language is JMeter written in?

Java. The JMeter user manual describes it as “a 100% Java application” that runs on any system with a compliant Java implementation, and it lists “compatible with Java 8 or higher” as the requirement. That has two practical effects. JMeter needs a Java runtime installed (the manual recommends a full JDK, because recording HTTPS traffic needs the keytool utility), and its memory behaves like any Java program’s: it is limited by the JVM heap, which you raise with settings described in our guide to increasing the heap size in JMeter.

It also means you can write your own samplers, listeners and other components in Java, compile them into a jar and drop it into lib/ext. Most people never do this, because the JMeter Plugins Manager already offers well over a hundred ready-made ones.

What format are JMeter test plans in?

A saved test plan is a .jmx file, which is plain XML. You can see this by opening one in a text editor: it starts with <jmeterTestPlan> and contains one element per thread group, sampler and listener. The XML is generated by the GUI, and you can keep it in version control, diff it and run it from the command line. The format is not a language you program in; the elements and their settings are the test. How those elements run is explained in how Apache JMeter works and in the guide to the execution order of JMeter elements.

Do you need to know a programming language to use JMeter?

No. Samplers for HTTP, JDBC, JMS and more, plus timers, assertions, extractors and controllers, cover most tests without code. Knowing regular expressions helps more than knowing Java, because extractors and assertions use them to read values out of responses. For feeding different data to each virtual user, you use a CSV Data Set Config element instead of code, as in our guide to parameterization in JMeter.

Which scripting language should you use in JMeter?

Use Groovy, inside a JSR223 Sampler, JSR223 PreProcessor, JSR223 PostProcessor or JSR223 Assertion. The JMeter best practices page recommends Apache Groovy for JSR223 scripting, mainly because the Groovy engine supports script compilation. JMeter 5.6.3 also ships with Groovy as a runtime dependency (3.0.20, read from the ApacheJMeter_core 5.6.3 pom on Maven Central), so you do not install it separately.

The comparison across the languages you will see in the Scripting Language drop-down:

LanguageWhere you meet itWhat the JMeter manual says
GroovyJSR223 elements, the ${__groovy()} functionRecommended. The manual lists it as a language that supports compilation, so a cached script runs fast under load.
BeanShellBeanShell elements, ${__BeanShell()}Older. The manual advises migrating to a JSR223 Sampler with Groovy “for performance”.
JavaScriptJSR223 elements, ${__javaScript()}The manual says it is not the best choice for performance and suggests __jexl3 or __groovy instead.
JavaJSR223 elementsThe manual lists it among languages that do not support compilation.

Two settings matter when you script at load. Tick Cache compiled script if available in the JSR223 element, and read variables with vars.get("name") instead of writing ${name} inside the script, because the cache stores the script text after the first substitution. A tiny example of a JSR223 PostProcessor in Groovy:

def body = prev.getResponseDataAsString()
if (body.contains("Out of stock")) {
    vars.put("inStock", "false")
} else {
    vars.put("inStock", "true")
}

prev is the previous sampler’s result and vars holds the thread’s variables; both are provided by JMeter to JSR223 elements. Before you reach for a script, check whether a built-in element can do the job. When you do write one, the guide to JSR223 Sampler and Groovy scripts lists the variables JMeter provides and what happens when a Sampler, Assertion, PreProcessor or PostProcessor script throws.

Can you script JMeter in other languages?

Beyond the scripting languages above, the JMeter manual notes that “there are other languages supported than those that appear in the drop-down list” if their jar is in JMeter’s lib directory. In practice, stay with Groovy. If your team prefers Python or JavaScript for load tests, that is a reason to look at a different tool; for example, k6 tests are written in JavaScript. The k6 vs JMeter comparison goes through that choice.

Running your JMeter tests in the cloud

Whatever language you script in, the .jmx file is what you run. LoadFocus takes your existing .jmx file and runs it from its cloud locations; its JMeter page states that thread groups, CSV data, JSR223 samplers and plugins are preserved.

JMeter Load Testing from LoadFocus

Frequently Asked Questions

What is JMeter written in?

Java. That is why it needs a Java runtime (Java 8 or higher), why it is configured with JVM settings such as heap size, and why you can extend it with your own Java components.

What language do I script tests in?

Groovy, through a JSR223 element. The JMeter manual recommends it over BeanShell and JavaScript because its engine supports compilation, which keeps scripts fast when many threads run them.

Do I need to code at all?

No. Most test plans are built entirely from built-in elements in the GUI, and scripting is needed only for logic those elements cannot express.

Is JMeter’s test plan format a programming language?

No. A .jmx file is XML that the GUI generates and reads. It describes the elements of a test; it has no logic of its own beyond what those elements do.

Is BeanShell still supported in JMeter?

It is still part of JMeter, but the manual advises moving to a JSR223 Sampler with Groovy, so use BeanShell only to keep old plans running.

Sources

  • Apache JMeter user manual, Getting started (Java 8 or higher, 100% Java), jmeter.apache.org/usermanual/get-started.html (October 2026)
  • Apache JMeter user manual, Best practices (Groovy and JSR223, compilation, BeanShell migration), jmeter.apache.org/usermanual/best-practices.html (October 2026)
  • Apache JMeter user manual, Component reference (JSR223 and BeanShell Sampler), jmeter.apache.org/usermanual/component_reference.html (October 2026)
  • Apache JMeter user manual, Functions (__groovy, __BeanShell, __javaScript), jmeter.apache.org/usermanual/functions.html (October 2026)
  • ApacheJMeter_core 5.6.3 pom, repo1.maven.org/maven2/org/apache/jmeter/ApacheJMeter_core/5.6.3 (October 2026)

Run this JMX in the cloud, from 25+ regions

Upload your JMeter script to LoadFocus and run it with thousands of virtual users from 25+ cloud locations, with no load generators to manage. Results show p95/p99 response times, throughput and errors per request, and a free tier is included.

JMeter Cloud Load Testing

Free API Load Test

Bogdan

Founder at LoadFocus

Bogdan builds and runs the tools this blog is about. He writes from what the products actually do in production, including the parts that break.

Weekly tips right in your inbox.

Don’t miss out on the latest testing tips and tricks, tools and news related to software testing.

Already +20,000 members in the list.

The Load Testing Platform with AI That Explains Your Results

Load test websites and APIs from 25 cloud regions, monitor page speed and uptime, and get AI analysis that explains your results in plain English.

Cloud load testing, website speed and API monitoring in one place.

Hi there! Can I share a cool thing I'm working on with you?

A software testing newsletter that sparks joy.

Our goal is to create helpful content for software developers and testers.

If you're not into it, you can unsubscribe instantly.