As per my knowledge, you are getting this error because the only way to call a non-static method from a static method is through an instance of the class containing that non-static method. If you go by the definition, a non-static method is one that is called ON an instance of some class, on the other hand, a static method belongs to the class itself.