Unable to connect to hive shell

Trying to connect to hive shell but not able to connect to. Getting the error :
Please use beeline (or another JDBC client) to access data with Hive 2.
Earlier was able to connect to shell through just hive command.