If you want to run your testng.xml files without any IDE or build tool, first you need to install Java on the system. In addition, you also need to set its path into the environment variable.
And first, you need to compile Java code using the command prompt. For this, you need to open the command prompt and go to the PROJECT_HOME directory.
Type Following command in terminal
javac -classpath libs/* -d ./bin ./src1/com/example/tests/*.java ./src2/com1/example1/tests1/*.java
if you are using windows then
dir /s /B *.java > javaFilePath.txt
This command will search all the .java files in current and subdirectory and put the entire Java file path in ‘javaFilePath.txt’ file.
You can compile the entire Java file using the below command.
javac -classpath libs/* -d ./bin @javaFilePath.txt
if you are using Ubuntu then
$find -name “*.java” > sources.txt$ javac -classpath libs/* -d ./bin @javaFilePath.txt
and after run the testing.xml file with using below command
java -cp bin;libs/* org.testng.TestNG TestNG/testng.xml
Now, you may run your testng.xml files without any IDE or build tool.