Use the NetworkTables API. You can add networktables-desktop.jar as a dependency in a java project which can be read in the default networktable java API.
Canβt you just plug a crossover cable between the two and change your connection type on the driver station? Or is your question more complicated than that?