Java essentials for JMeter
There may be instances where the features that come out of the box with JMeter are not sufficient and custom scripts are needed to perform specific tasks. JSR233 and Beanshell assertions/samplers can be utilized in cases such as these to get the job done. Both these components support Java code, and hence it is important to acquire basic Java knowledge. In this section, let’s go through a quick introduction to the Java programming language.
A quick introduction to Java
Java is a platform-independent compiled programming language. Java code gets compiled into bytecode, which can then be executed on any OS. The Java Virtual Machine (JVM) is the OS-specific architectural component that sits between the compiled bytecode and the OS to make it work on any platform. Let’s now create our first Java program, compile it, and run it. Any Java program comes with a boilerplate code, as follows:
package ch8;
public class first_java_program {...