I can share my experience. I am a very experienced user of Adobe's Flash program. I have specialized experience that is useful for a large segment of non-expert Flash users. So I put together a dynamite book proposal that teaches Flash to people who are forced to use it as part of their arsenal but don't want to wade through 600-page texts full of irrelevant (to them) technical information. It was targeted at ad agency designers, web designers, film makers, etc., and designed to be useful for teachers to teach basic animation skills in high school and college art classes. Sort of sounds like your java book idea.
I sent it directly to computer book publishers. By the way, computer books is one market where an agent is 100 percent unnecessary; every publisher responded to me personally and in detail, no boilerplate rejections. It is also a market where timing is crucial. The sales window for any book is the few months after a new version of the program is released, and they sign up all the next texts around 9-12 months before that. So you need to actually be a beta tester learning the program behind-the-scenes and writing the book at the same time, in order that the book is ready for release at the same time as the program. That was one of my weaknesses; at the time I didn't have that insider access (now I'm a beta tester, so I'm considering a fresh round of proposals).
The other weakness, spelled out loud and clear by every publisher, was that they already have a list of authors they like to work with. That isn't to say they aren't looking for fresh authors, but in that case they really demand PLATFORM. I know two guys who wrote Flash texts around the same time I proposed mine. Both of them are well-known in the Flash community because they have well-read blogs and they speak at all the main Flash, computer and animation conferences. I have terrific credentials, but no visibility, since I've never spoken at those conferences. And even a speaking gig at one of those is near-impossible. I discovered that if you're not already a "star" in the community, then you can pay to speak at the conferences, or find sponsorship from a relevant company. Yes, a large number of the speakers at computer conferences apparently paid for the privilege of being there. They know how their bread is buttered. Everyone wants the platform in order to further their careers.
Finally, the final downfall of my proposal was that my market was too specialized. Sounds odd, if you look at what I said. I thought my market was people who weren't already buying expensive Flash books. But most computer texts are aimed at the widest possible market. With so many computer books selling for such short periods, the total numbers they sell to general users is pretty small actually. There are very few break-out bestsellers. So the idea of writing for a specialized segment of that small market doesn't work. One publisher even shared with me her sales figures for previous attempts at selling books to specialized segments of the Flash user market.
Every publisher praised my proposal as one of the best, most thorough and well-written proposals they'd ever seen. But in the end I was turned down by all.
Sorry I can't be encouraging. By all means, write a proposal and send it around. But be aware of the realities of this specialized corner of the book market.