I could not sleep yesterday and i was thinking about this problem. So i might figure out what happened.
When you execute a JAR or Java file for the first time, a
firewall window appears asking for the permission of that program. I generally select
private network and uncheck
public network, so i guess that caused this problem.