It does not have to do with java. Here is part of what it does:
This is only partly a user process -- it starts before anyone logs into the computer, and is responsible for displaying the login screen (or not, if autologin is set), validating login attempts, and setting up the user environment (launching the Finder, Dock, any login apps, etc) at login. It also acts as a process monitor for user processes, restarts the Finder or Dock if they crash, and implements the Force Quit Applications window. Finally, it handles the logout, restart, and shutdown procedures.
Did you force quit it or just quit it?
You can always use terminal
sudo killall loginwindow