It happens when a country doesn't have enough developed institutions, and finds out that they have natural resources. Having money in the country gives comfort and freedom to public officials, and they try to stop the development of those institutions or completely destroy them. As a result, it leads to lack of democracy which itself leads to lack of economical growth. In case of Azerbaijan, the country started to export its petrol just right after getting its independence from the Soviet Union. At that time it was a new country, and didn't have any proper institution. In general, it is an unfortunate situation which is extremely hard to fix.
Actually, I find Python and Ruby much more interesting than Java (actually, Java seems as a boring language :) ) . But since Java is general purpose language and it's known as market skill, I want go for it.
I have the same problem nowadays and think about migrating to Java for web development. I heard about Play! framework very much. Do you think Java is a good idea for web over Python and Ruby?