I've been considering the same thing but for a Scorched Earth/Gunbound style game.
To make the kind of game you are talking about there are going to be two parts:
- The client side (player's browser)
- The server side (your game's server). This encompasses:
- The language used on the server
- The database used to store data
Short Answer
For the client side your two options are pretty much (in no particular order):
- Javascript + HTML
- Actionscript (Flash)
For server side languages (again, no specific order):
- Javascript via node.js (see Bane's answer)
- PHP (see Lohoris's answer)
- Java (sorry don't really have a link, but you mentioned you are familiar with it)
- Ruby
- Python
For databases (no specific order):
- MySQL
- Postgresql
- MongoDB (this is a NoSQL database)
Long Answer
The server side can be pretty much whatever the heck you want it to be. You'll likely want support for sockets which PHP and node.js support, making them viable options. Your question mentioned you are familiar with Java and that's a viable option as well. If you're comfortable with Java (and not doing this to learn new languages/technologies) that's may be your best bet.
As far as databases go MySQL and Postgresql are widely supported and established databases. Something like MongoDB is a bit more exotic and may not be supported by your server side language of choice. Me, I'd probably use Postgresql unless I was interested in mucking around with NoSQL or thought it gave some clear, tangible benefit.
On the client side, game interactivity is going to require either Javascript or Actionscript (i.e., Flash). None of the games you called out look like Flash games to me or, if they are, they appear like they could be made without Flash so I'd recommend you stick with Javascript here.
As for integrating with payment gateways and other third party solutions you'll want to checkout things like PayPal and see what they support. Typically they support a few different languages (PHP and some flavor of Microsoft are usually safe bets) and have code samples in all supported languages. The Facebook API is friendly with PHP and Javascript.
Other Considerations
Does Your Game Need To Use Sockets?
Both Flash and Javascript** support socket connections. Flash does this via the Socket class and supports sending and receiving binary data. As mentioned by Bane there is a node.js Javascript implementation of sockets via socket.io. However, binary sockets are not supported and browser support can be iffy (though socket.io compensates for this).
To me this then becomes one of two questions:
- Which technology do I want/need to use server side? Or,
- Which technology do I want/need to use client side?
In my case I wanted to use Javascript on the client and node.js + socket.io seems to be the best (possibly only, certainly easiest) technology that would enable socket connections to the server. So I'm using Javascript + HTML in the browser and node.js on the server. Another benefit is that I'm using the same language on both the client and the server which is nice.
If I needed binary sockets or wanted to use Java on the server I'd probably choose Flash on the client side. There are a lot of socket servers written in Java for the express purpose of supporting multiplayer Flash games (SmartFox is one example).
** Via WebSockets in most modern browsers.
Can You Get By With Remote Procedure Calls Instead of Sockets?
If you can use RPC (think AJAX) then you're really free to do things however you see fit. Just about any browser (even the shambling corpse that is IE6) supports AJAX calls, as does Flash. Likewise any server technology is going to be able to respond this these requests. If your design allows for this it really becomes a matter of which technologies you prefer.
What Languages Are Supported By Third Party Solutions
If you'll be integrating with third parties you should check out what technologies they support. While there is no reason you cannot run the game server in Java and integrate with your payment gateway in PHP but it would probably be easier to just have it all be in one or the other.