I don't understand the question, nor where Java comes into this.
You can do all you're asking for using the server side language already in use. By dead accounts, I assume you mean no longer active in session, not accounts that are inactive since they have no relevance.
In order to do what you want, you'll need to either:
Write custom session handlers and preferably a dbms to store them in. This lets you select where newer than a certain age, and order them. It also allows purging.
Or: write a custom parser for the existing PHP sessions. Iterate a *custom* directory (do NOT use the default location for sessions; that can get you in a lot of trouble on a shared host) where you store your sessions, and read and parse every session file. This will let you read the user information out of it to build the list. Do not be tricked into believing that PHP session files are standard serialized - they look like they are, but they are not. You can use the WDDX setting though, which can be used in conjunction with wddx_deserialize making it a lot easier.
Although, to add for the Java perspective, than yes this would be easier. Java applets would be run on a client side, so you can establish RMI connectivity to a base server. When the user leaves, it can be detected by the server, and they can be removed from the list.
This is pretty much how java chats worked way back in the day.