I have been working on Ubuntu 15.04 and faced a similar problem. I used maven to install testng. The advantage was it installed all the dependencies along with it. If you are not using maven, then along with testng jar, download jcommander and beanshell jar files as well.
When executing the class files after compilation provide the classpath of the following:
- testng jar
- jCommander jar
- beanshell jar
This is the command I used on my system to run the same example code as mentioned on TutorialsPoint:
java -cp /home/phantom/TestNg\ tutorialsPoint/Programming1:/usr/share/maven-repo/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar:/usr/share/maven-repo/com/beust/jcommander/1.35/jcommander-1.35.jar:/usr/share/maven-repo/org/testng/testng/6.9.5-SNAPSHOT/testng-6.9.5-SNAPSHOT.jar org.testng.TestNG testng.xml
Programming1 is the directory where my .java and .class files are stored.