To J2EE or ASP.NET, is a question that any web developer would have asked. While I myself know neither the two too well, it is natural to think which one I should pick up first. Just like many php veterans, because working with Open Source technologies often means low pay, I am considering to get some extensive knowledge about commercial technologies.
At this point I actually already had some experience with both of the two frameworks. I learnt some JSP/Servlet in my Web Programming course, and for ASP.NET I’ve read through half of a book called “ASP.NET complete reference” on my own. Yet I haven’t reached to more advanced levels such as security, web service, or cluster deployment etc. So let me just write down some thoughts and comparisons between them as an entry-level developer, and see how the actual learning experience turns out later.
I will start by skipping the definitions of the two, but putting the links to their wiki page respecitively, since both of them claim hundreds of advantages by using multiple adjectives in their definitions, such as “super scalable, easy to maintain, ultra secure XXXXXX”.
Development Language
J2EE is built on J2SE so Java is the only language used in development, although a J2EE application can communicate with other applications language-independantly through web service. Java is the programming language I started with. Being leverage by many modern languages including .NET languages and JavaScript, it is one of the most essential computer languages that everyone should know about. And there are a large population of developers favoring it.
ASP.NET is a subset of the whole .NET framework therefore inheriting the merit of CLR(Common Language Runtime), which means users can develop ASP.NET in virtually any language like Microsoft’s own C#.NET, VB.NET, and third-party languages Python etc., as long as it can be compiled into CLR. By leverage many of Java’s successful features and architectures, .NET framework is able to start at a higher level. With many things like Properties, Generic Types, function delegates etc. that don’t exist in Java, it makes the code much cleaner and easier to maintain.
Availiability/Development Platform
Since J2EE is open source and running on cross-platform JRE(Java Runtime Environment), it natually gets more distribution potentials than its competitors. When an application is released, it’s possible to deploy it on Linux, Unix, Solaris, MainFrame machines, and of course Windows. As for developers, any platform on hand can do.
ASP.NET is plain simple, Windows. There are some tricks so that one can run .NET on linux, but that really adds much more overhead and complexity to the task.
Development Tools
For both there are full-featured IDEs( Integrated Development Environment) and their free versions.
Eclipse with its rich collection of plug-ins, fits for any developers to write full-featured J2EE applications. While its big brother, RAD( Rational Application Developer), built on top of the same architecture, provides much more task simplification functions that allows a quicker development and deployment cycle. However because they depend on JRE to run, the loading time sometimes intimidate me to open it if I just need to make small changes.
ASP.NET comes with quite a handful of free development tools too, namely Visual Studio 2005 Express Edition, which by name people can see it’s a subset of Visual Studio 2005. Frankly speaking I find Visual Studio is easier to use than Eclipse. I guess it mainly comes from its quick loading time, code segment folding, and autoformat/Intellisense etc.
Licence and cost
Individuals and even many startups usually cannot afford a WebSphere Application Server + AIX combo, but in many cases a Tomcat + Linux machine could survive for a few months too, which is just enough for learning the technology.
ASP.NET runs smoothly on any Windows machine with .NET 2.0 framework installed, at no extra cost, with no extra headaches.
Library Reference/API
Javadoc was the most well organized API, comparing to those for C, C++. It’s also the one that generates docs automatically from code comments. But I believe ASP.NET doc, integrated into MSDN, did a better job in guiding users solving tasks and understanding classes. It gives quite a lot of example codes in the API rather than just plain text descriptions, cause much less circular references and thus saved lots of hassles. Although at MSDN people has to drill down into the hierarchy to find APIs for a particular topic, and sometimes it takes quite a while to figure out precisely where the doc is at.
Salary/Compensation
Now let’s do a bit of comparison of salaries!
J2EE developers’ Average Salary is around $78K, with high end (architect, seniors) over $10K. quoted from http://www.indeed.com/salary?q1=j2ee+developer&l1
.NET developer’s Average Salary is around $73K, quoted from http://www.indeed.com/salary?q1=net+developer&l1

So J2EE developers do get paid a bit more, since from Enterprises’ perspective, J2EE is probably a more stable architecture and it’s almost being used in all mission critical systems in major banks, who invest billions to hire people administration J2EE servers and applications running on them.