A tutorial of setting up and using Wi-Fi peer-to-peer connections between Pocket PC
After that you just need to write a simple socket server and you should be good to go.
Below are a couple of JVMs that will run on Windows Mobile.
Mysaifu JVM
Product page
Mysaifu JVM, according to the official product page, is a "Java Virtual Machine which runs on Windows Mobile. It is a free software under the GPLv2 (GNU Public License Version 2)."
Mysaifu JVM (Java Virtual Machine) will work with most Windows-based PDAs and PDA phones, including those that run on Windows Mobile 5.0, 6.0, Windows Mobile 2003 for Pocket PC, and Windows Mobile 2003 Second Edition for Pocket PC. The actual size of the files is quite small at just 5MB, but you'll need about 10MB of free space in order to complete the installation.
Ewe Launcher
Company page
Ewe is actually a "programming system that allows you to write applications, using Java, which run exactly the same on desktop systems, on mobile systems, and even in a Web browser as an Applet." In this way, it's not exactly a free Java runtime environment (J2RE) for Windows Mobile, but there is a Ewe Launcher which seems to fulfill this need.