Could anyone please explain me what is the connection between JMS ans Salesforce platform event? Is both are doing the same job?
There is no connection between JMS and Platform Events. They both serve the same purpose, but do so via different protocols. You cannot use JMS with Salesforce directly (you would need an adapter), but you can use Platform Events in Java (but it would not use JMS at that point).