The simplest approach would likely be to use a unit like the callerID units from CallerID.com,
http://www.callerid.com/They make both serial connection units and ethernet based units that are not too expensive, though the minimum is a 2 line unit. The reason I suggest them is that they provide a full SDK with examples and are very easy to program with in a number of languages including Java.
It would be less expensive to just use a modem to catch the caller ID but does involve a bit more work than using the SDK from the callerID.com units.
Of course there are a number of programs that might work for you off the shelf,
http://www.identafone.com/index.htmAs well as open source free programs that might serve directly or as a example to work from,
http://sunflowerhead.com/software/yac/Specifically take a look at the 'For Developers and Power users' section. Likely something you can interface with java easily.
Asterisk is more than capable but would be overkill for just doing a screen pop. You not only have to setup asterisk but also would require a analog phone card or device as well. If you wanted to do anything more down the road Asterisk would be a good choice.