I post a lot of negative stuff on Java, but I still think it's excellent. However I just don't think C# is a bad as some people here claim, and I really don't like all the half truths posted about how bad it is. The reality is that this is a discussion between two languages, which are
both well made, with very active ecosystems and very mature!
Yes you can develop for free but actually selling a product takes more effort on c#
Point Java
Simply not true.
If your selling a product yourself, then the difference is mute, but I'd argue C# is easier. This is because Microsoft have put working into building re-distributable copies of .NET and XNA, specifically for use with installers, making the process of distributing .NET with your application much easier. Re-distributing Java with your application is not difficult, but you have to do it yourself.
Further Windows 8 is getting a Windows store, with distribution integrated into Visual Studio. This will allow you to sell C# projects much easier. C# also has the XNA Community Developers channel (or whatever it's called), which allows you to sell your XNA games on the 360. It's not massively popular, but some people have made a decent amount of cash.
In comparison Java briefly had the Java Store, which was truly terrible, and was cancelled ages ago. The Windows 8 store also allows you to sell existing applications, which would including those built using Java.
So C# wins this hands down, because Java has nothing to help you.
Yes you can use C# on linux but some things don't work and some things only half work
Point Java
If you are using threads, OpenGL, Swing, Java2D or anything involving audio, then you can easily encounter cross-platform issues with Java. It's far better then C#, but far from perfect.
If you target difference devices, then you do need to be platform specific. Different screen sizes, input configurations, and other factors make this a reality in any language, including Java. For example lots of Android apps work badly on Android tablets, simply because they just weren't designed for a larger interface.
Yes you can do robotics with both but I have encountered more java then c#
Point slightly java
Microsoft have their own
Robotics Developer Studio, where as with Java it's mostly a collection of various third party tools and libraries. As a result, you have to hack a lot of the bits together yourself. I have some experience using Java with simple robotics, and the fact is that most of these libraries are very hit and miss. Some work, whilst others tragically fail.
Lego Mindstorms, one of the best robotics kits for learning, works with both Java and C#. However it's also supported with the Microsoft Robotics Developer Studio.
Diversity, I'd say Java wins, but for maturity, I'd say C#.
Mobile development More java done then c#
Point java
Half true.
Old mobiles use J2ME, which uses Java 1.3 for the language, and their old APIs. It is also heavily dated, and only popular in emerging economies (namely China, India and Latin America). Android uses it's own VM, which has a mix of standard and non-standard libraries.
But the most important mobile platform is iOS, since it has the biggest ecosystem, and over 90% of all mobile applications are sold on iOS. Here C# has products such as
Mono Touch and
Unity, which allows you to build C# games/applications for both Android and iOS, using Mono. iOS development using Java is mostly non-existent (there are some proof of concepts floating around online).
For very old phones, Java wins hands down. For Android, Java wins, but C# is pretty good too. For iOS, which is the one that matters, C# wins.
Web based applications
Point Java
The JRE is far more popular then Silverlight. However Applets are partially blocked in Chrome, and Mozilla might be following suit. Both Java and Silverlight are fully blocked in Metro, but you can easily port Silverlight apps to Metro.
However Applets are universally worse then Flash, Silverlight or HTML5/JavaScript, due to the terrible startup times, lack of modern UI's, endless certificates for anything sophisticated, and a bad model for handling incorrect versions and plugin updates.
For converting to HTML/JS, there is GWT for Java, which is outstanding. But there is also
Script# for Silverlight, which is used heavily within Microsoft (I believe Hotmail is built using it), and so it's also pretty mature. There are other alternatives for C#, such as
JSC (but I'd go with GWT or Script#).
So if your using a plugin, Java is more popular, whilst Silverlight gives a far superior experience, but neither are the best (I'd recommend Flash of HTML5/JS). For converting to HTML5/JS, Java wins simply because GWT has more use/examples/libraries/ecosystem, but C# is still an excellent choice.