Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As a professional Java programmer, I've been trying to understand - why the hate toward Java for modern web applications?

I've noticed a trend that out of modern day web startups, a relatively small percentage of them appears to be using Java (compared to Java's overall popularity). When I've asked a few about this, I've typically received a response like, "I hate Java with a passion." But no one really seems to be able to give a definitive answer.

I've also heard this same web startup community refer negatively to Java developers - more or less implying that they are slow, not creative, old.

As a result, I've spent time working to pick up Ruby/Rails, basically to find out what I'm missing. But I can't help thinking to myself, "I could do this much faster if I were using Java," primarily due to my relative experience levels.

But also because I haven't seen anything critical "missing" from Java, preventing me from building the same application.

Which brings me to my question(s):

Why is Java not being used in modern web applications?

  • Is it a weakness of the language?

  • Is it an unfair stereotype of Java because it's been around so long (it's been unfairly associated with its older technologies, and doesn't receive recognition for its "modern" capabilities)?

  • Is the negative stereotype of Java developers too strong? (Java is just no longer "cool")

  • Are applications written in other languages really faster to build, easier to maintain, and do they perform better?

  • Is Java only used by big companies who are too slow to adapt to a new language?

share|improve this question

closed as not constructive by Jarrod Roberson, Walter, ChrisF Jun 12 '12 at 13:38

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

I think you're incorrect: it is still used, it's just lost cool factor. – user4051 Aug 18 '11 at 14:43
@Graham Lee: Java has ever been cool? I must've missed something. Well, I guess it's cold coffee, but cool? I think the main reason is that java, especially the enterprise java frameworks have been and still are heavily overengineered. You can't consider them lightweight, you just use them because you need the distribution/balancing/scalability features of the platform and want to use a framework for the frontend that is done with java, too, for the sake of homogeneity. – Falcon Aug 18 '11 at 14:57
Maybe, because it's not modern? :P And Java never was cool, simply because it threw the hacking part out of programming. – back2dos Aug 18 '11 at 15:25
@Falcon Java was cool back when it was first introduced, Sun did a great job hyping Java, whether the hype was justified or not has nothing to do with it being cool or not, a lot of cool things are hyped for no reason. – Mahmoud Hossam Aug 18 '11 at 15:40
@Falcon, you should have a look at creating web applications with JSF 2.0 in Java EE 6 and compare it to your experiences. You may be pleasantly surprised. – user1249 Aug 18 '11 at 17:10

39 Answers 39

Java was cool, Java is cool and Java will be cool in future. I'm developing a web App. Using Java.

The main problem with Java is it needs a medium size team 7-10 people to see the results of implementation. Developers of the back end must have the knowledge of application architecture from ORM to Application framework to presentation layer. Too many options for developers on the table, and this raises the questions, is it a good idea to use a ORM or not? Which ORM framework to use? Which application framework to use? How to implement the front end? All this makes the developers struggle and makes the combinations endless from the end user to pick this technology with that framework that developers are not familiar with. The same is with IDE plugins; too many options, a lot of time is spent on installing, configurating, and testing if this version of a plugin works with this version of the IDE and so on. The last thing is hosting; many developed Java Apps don't go out to public because there is no proper web hosting for Java web apps, getting one VPS for $80/month is not an option for too many developers, and most applications needs more than one VPS.

share|improve this answer
Developers of back end must have the knowledge of application architecture from ORM to Application framework to presentation layer basically means that the framework has failed to do its primary objective. – Lie Ryan Jun 11 '12 at 2:23

The problem with Java is that this language is learnt in school, so it's the language the most known by new programmers. So if you want to differentiate yourself from the mass, you have to learn a new language, Java is the language of the everybody.

The second reason is that at school or in big companies when you want to build a web application, teachers or people already in place give you tons of java frameworks to help you to build this application faster. But in fact, in this way you build your web application without really understand web (HTTP, HTML, CSS, Javascript, etc...). This trend is less visible with other languages like RoR or Python, developpers using these languages have a better understanding of the web.

So the statups who want to build modern web applications prefer to use RoR, PHP or Python to attract good web developpers, those who understand the web and not only a programming language.

share|improve this answer

If by "modern" you mean popular (as-in getting most press coverage) then the reason Java is not used is very simple -- because all the "cool kids" are using Ruby (or Python, or Clojure, or Scala, or whatever is "cool" these days).

There is a deeper meaning to this, these same people who use Ruby or Python to write their "modern" web applications are usually really great innovators. People who love solving annoying problems in simple and effective ways while saving time and brain power doing it. Some might say these are qualities of good programmers.

These people usually also create the most press around their projects, which large companies rarely do. Be it by doing lots of open-source, or writing blogs, or whatever.

So the gravitational pull of these people into the world of dynamic languages, where they are offered simpler/smaller/faster/leaner ways to solve problems is easy to understand. Sadly it means that the same people who were great Java developers, mature and abandon the Java bandwagon because it is annoying and hard (for them) to use and solve these same problems.

If creating a simple web application with MVC framework X, requires to write/edit just 100 lines of code in Rails/Django, and contrary to that it requires 10,000 lines of code in Java to do the same thing - it is very apparent why that might seem annoying.

Regarding your statement "I haven't seen anything critical "missing" from Java, preventing me from building the same application." The question is -- if you had the same amount of experience in Rails/Django/Whatever... how would these two applications Java and non-Java compare to each other, measuring time and effort and any other metrics you can come up with.

share|improve this answer

An interesting answer is given by Dries Buytaert, who founded drupal. Although his PhD was about java, he chose php for drupal, and he didn't regret doing so. You can read it (and some of his comments) here:

It would have been very difficult to get critical mass if Drupal was written in Java.

share|improve this answer

I'm using a lot of Java, for creating web applications. So, when it comes to the *language itsel*f, I find only one (but big) issue - lack of multiline support. This makes printing/templating in pure Java code very unreadable.

But the real problem is the lack of good web frameworks. I've worked with a lot of solutions, and none of them I could name good or even satisfying.

Most of them are in fact XML programming. In JSF you produce tons of XML, and if you want to change some general feature, like rearange labels to the top of the text fields, you'll end up in doing the same change in multiple places. Yes, you have includes, but compare them with the includes from PHP...

Additionally, new JSF includes "extra" features which were known to the JavaScript frameworks years before...

ZK is a bit better because it allows creating the web elements in the Java code, which makes the modifications easier (if you use OOP properly - inheritation etc.). However, this Java code is executed on the server side, which is a great performance issue - every click will cause a package to be sent to the server.

Well, GWT is the best web framework I've worked with. It allows object programming in the web design. Every element on the screen is represented by the Java object, which gives you full flexibility but... The compilation time is very long, and the generated Javascript is far from optimal, simply because GWT isn't utilizing fully the JavaScript possibilities (no support for the reflection, at least in the version I was using, and fatal implementation of HashMap).

You can use templates, such as Velocity, but as above, they are a poor-man's version of the templating possibilities given by such languages as PHP.

So, it's not a hate towards Java, but the lack of support for writing web apps that one will get when using PHP, Python etc...

share|improve this answer

Short answer, Java is a great platform / ecosystem, just as long as you have a suitable language to develop for it in (ahem... Clojure). :)

share|improve this answer
how does this answer the question asked? – gnat Oct 6 '13 at 16:27

In my company we use php and not java because the final server is more expensive. For a great project it's not important, or less, but for the other projects it's a reason. the final customer want to pay as little as possible maintenance and a php server is easy to find everywhere but java hosting no.

share|improve this answer
Personally, server costs are amongst the lowest parts of our monthly spend. Even the lowest level support technician is an order of magnitude more per month than total server outlay. – Matthew Schinckel Jun 10 '12 at 12:41

Java is tedious and verbose, but is still very useful when you need a cross-platform, GUI app that runs on hardware that is ill-defined.

For example, Amadeus (the largest airline/reservations system in the world) uses Java for its front end very successfully. The benefit is its simple deployability across multiple platforms (usually PC's, but of a horrendous array of specs ranging from 80386's in Peru to Core i7's in Europe). Sure it's a bit ugly, but does the trick, currently running on 10s of thousands of machines.

share|improve this answer
But... we're not talking about cross-platform GUI apps: this question is about web application development. And your arguments are mismatched: "Java is tedious and verbose" is a criticism of the Java language, while all the cross-platform benefits are features of the Java platform. It is possible to write apps for the Java platform in languages other than Java: see Jython, JRuby, Groovy, Scala, Clojure, etc. – Daniel Pryden Aug 22 '11 at 18:20

Compiled langauges like Java enforce too much discipline for start-ups to follow. PHP on the other hand is moldable to the extent of being incomprehensible. Discipline and flexibility are generally opposed to each other.

share|improve this answer
There are plenty of third options that don't have either weakness. – user16764 Jun 10 '12 at 13:06
Startups != "undisciplined" – canadiancreed Jun 10 '12 at 13:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.