First, your hyperbole is a little off:
You have to recompile every time you modify any line of code and pass the built EAR or WAR to the application server...
That depends entirely if you are using JSP or some other template library to build your application. JSPs and most alternative templates allow you to edit in place and simply reload the page. You just have to remember to copy those changes back to your repository. But there's more, see below.
Why Java?
The biggest advantage that Java has over several other languages is the ecosystem surrounding it. Whether you are building a Spring based application or doing your own thing, typically there is some API out there that is ready to support what you want to do. The Java ecosystem has largely specialized on the server side. Knowing you don't have to reinvent the wheel is a big boon.
Does Java have it's downsides? Absolutely, but that applies to every computer language invented. If you don't think so, you probably haven't built anything substantial with that language.
Blaming Java for a slow build is unfair. Take some time to see if a better build tool can improve your build times. If your build server is anemic, take time to figure out how to improve how it builds. For example, I have a project that takes 2.5 minutes to build on my local machine to compile and create a deployment package from all the Java, C#, and Python pieces. The same process on the build server takes 14 minutes. A lot of that has to do with disk speed and it being an older server. Fix the build.
Why not an interpreted language?
That really depends on the platform you are building and the team you have. It's one thing to say you are using Ruby on Rails or PHP, etc. and another to find competent developers to support your app. To be honest, the personnel issue is the one reason we migrated away from Ruby on Rails in a project.
That said, there are very few technical reasons not to use an interpreted language. Typically it depends on if you can find all the support libraries you need for your particular domain.
- Pick the language that serves your needs best--including finding people
- Be careful to work in a way where you can commit working code to version control
- Be objective when selecting your platform. An app is bigger than the framework or language it's built in.
They aren't mutually exclusive
For teams that use Java for web services and build Single Page Apps in JavaScript, they have the best of both worlds. The user interface is built using one of the many Single Page App platforms with the advantage of being able to experiment quickly. Meanwhile the web service part which doesn't typically change all that much can just be used.
In this world of microservices, it's becoming increasingly common to have a heterogeneous set of technologies. For example, you might have a python based service to take advantage of the natural language support libraries for part of your app mixed in with Java based infrastructure pieces.
ant
job. Theant
job, therefore, only has to run one time per release, prior to your integration testing or whatever the next phase in your development process is.