Comparison of the Java and .NET platforms

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Legal issues[edit]

License[edit]

Java[edit]

The primary implementation of the Java platform is available as an Open Source implementation called OpenJDK.

While "Java" is an Oracle trademark, and only Oracle can license the name "Java", numerous free software projects exist that are compatible with Oracle Java. Most notably, GNU Classpath and GCJ provide a free software class library and a compiler that are partially compatible with the current version of Oracle Java.[1] Sun Microsystems, owner of the Java platform before being acquired by Oracle, announced on November 13, 2006 that all Java source code, excluding closed-source code for which they do not retain rights, will be released under a modified version of the GPL,[2] and released two fundamental parts of the JRE and JDK: HotSpot and the javac compiler under the GPL.[3][4]

Following their promise, Sun released the complete source code of the class library under GPL on May 8, 2007, except some limited parts that were licensed by Sun from 3rd parties who did not want their code to be released under an open-source license[5] (see also Free Java implementations). Sun's goal was to replace the parts that remain closed with alternative implementations and make the class library completely open.

In June 2008, Red Hat announced[6] that the IcedTea project has passed the rigorous Java TCK, indicating a fully functional open-source implementation of the Java platform.

.NET[edit]

Microsoft's .NET CLI executable environment and some of the corresponding class library have been standardized and can be freely implemented without a license. A few standards-compliant free software environments have been implemented, such as the Mono Project and DotGNU. The Mono Project has also implemented many of Microsoft's non-standard libraries by examining Microsoft materials, similar to GNU Classpath and Java.

Microsoft is currently distributing a shared source version of its .NET runtime environment for academic use. However, it is only supported on Windows 7 and has not been updated after .NET 4.0.[7] For .NET Framework 4.5 and newer, ref name="referencesource">Microsoft Reference Source website is available, where source code can be downloaded or browsed online.

The Mono project aims to avoid infringing on any patents or copyrights, and to the extent that they are successful, the project can be safely distributed and used under the GPL. On November 2, 2006, Microsoft and Novell announced a joint agreement whereby Microsoft promised not to sue Novell or its customers for patent infringement.[8] According to a statement on the blog of Mono project leader Miguel de Icaza, this agreement only extends to Mono for Novell developers and users.[9] Because of the possible threat of Microsoft patents, the FSF recommends that people avoid creating software that depends on Mono or C#.[10][11]

The Microsoft/Novell agreement was criticized by some in the open source community because it violates the principles of giving equal rights to all users of a particular program (see Agreement with Microsoft and Mono and Microsoft's patents).

In response to the Microsoft/Novell agreement, the Free Software Foundation revised its GNU General Public License to close the loophole used by Microsoft and Novell to bypass the GPL's very restrictive provisions on patent deals.[12] The FSF also stated that by selling coupons for Novell's Linux software, the mechanism by which Microsoft circumvented the GNU license, it considers Microsoft to be a Linux vendor, and thereby subject to the full terms and conditions laid out in the GPL.[12]

The .NET landscape started to change in 2013, when Microsoft decided to open source many of its core .NET technologies under Apache License,[13] with even more donated to newly formed .NET Foundation in 2014.[14] Open sourced technologies include ASP.NET MVC, Entity Framework, Managed Extensibility Framework, Roslyn compiler-as-a-service infrastructure (together with C# and Visual Basic.NET compilers), F# functional-first language compiler,[15] and many more.[16] Microsoft and Xamarin announced collaboration, with the intent to increase cross-platform availability of .NET on Mac OS, Linux, and mobile devices.[17]

Traditional computer applications[edit]

Desktop applications[edit]

Although Java's AWT (Abstract Window Toolkit) and Swing libraries are not shy of features, Java has struggled to establish a foothold in the desktop market. Sun Microsystems was also slow, in the eyes of some,[citation needed] to promote Java to developers and end users alike in a way that makes it an appealing choice for desktop software. Even technologies such as Java Web Start, which have few parallels within rival languages and platforms, have barely been promoted.[citation needed]

The release of Java version 6.0 on December 11, 2006, saw a renewed focus on the desktop market with an extensive set of new tools for closer integration with the desktop. At the 2007 JavaOne conference Sun made further desktop related announcements, including a new language aimed at taking on Adobe Flash (JavaFX), a new lightweight way of downloading the JRE that sees the initial footprint reduced to under 2 Mb, and a renewed focus on multimedia libraries.

An alternative to AWT and Swing is the Standard Widget Toolkit (SWT), which was originally developed by IBM and now maintained by the Eclipse Foundation. It attempts to achieve improved performance and visualization of Java desktop applications by relying on underlying native libraries where possible.

On Windows, Microsoft's .NET is popular desktop development providing both Windows Forms (a lightweight wrapper around the Win32 API), Windows Presentation Foundation, and Silverlight. With the integration of .NET into the Windows platform, .NET apps are first class citizens in the Windows environment with tighter OS integration and native look and feel compared to Java's Swing.

Outside of Windows, Silverlight is portable to the Mac OS X desktop. Mono is also becoming more common in open source and free software systems due to its inclusion[18] on many Linux desktop environments.

Server applications[edit]

This is probably the arena in which the two platforms are closest to being considered rivals. Java, through its Java EE (a.k.a. Java Platform Enterprise Edition) platform, and .NET through ASP.NET, compete to create web-based dynamic content and applications.

Both platforms are well used and supported in this market. Of the top 10,000 websites, approximately 24% use ASP.net and 8% use Java.[19]

Some of Oracle's Java-related license agreements for Java EE define aspects of the Java platform as a trade secret,[20] and prohibit the end user from contributing to a third-party Java environment. Specifically, at least one current license for an Oracle Java EE development package contains the following terms: "You may make a single archival copy of Software, but otherwise may not copy, modify, or distribute Software." — "Unless enforcement is prohibited by applicable law, you may not decompile, or reverse engineer Software." — "You may not publish or provide the results of any benchmark or comparison tests run on Software to any third party without the prior written consent of Oracle." — "Software is confidential and copyrighted."[20] However, while Oracle's software is subject to the above license terms, Oracle's Java EE API reference has been implemented under an open-source license by the JBoss and JOnAS projects.

Microsoft's implementation of ASP.NET is not part of the standardized CLI, and while Microsoft's runtime environment and development tools are not subject to comparable secrecy agreements to Java EE, the official Microsoft tools are not open source or free software, and require Windows servers. However, a cross-platform free software ASP.NET implementation is part of the Mono project (minus webparts and Web Services Enhancements).[21] Mono supports ASP.NET 4.0 including Web Forms, Microsoft AJAX, and ASP.NET MVC.[22] While Mono supports ASP.NET MVC 3 applications, only MVC 2 is currently installed by default because the Razor view engine, while available as open source,[23] is not anticipated to be included officially until the 2.12 release.[24][25]

Embedded applications[edit]

Mobile applications[edit]

Google's popular Android platform for mobile application is based on Java. Google adopted a customised virtual machine called Dalvik to optimise the execution of Java code for mobile devices.

Oracle provides Java ME; a reference implementation for mobile OEM vendors. Java ME is made up of various profiles that are subsets of the Java desktop environment with additional libraries targeted at mobile and set-top-box development. Java ME has a very large base within the mobile phone and PDA markets, with only the cheapest devices now devoid of a KVM (a cut down Java Virtual Machine for use on devices with limited processing power). Java software, including many games, is commonplace.

While many feature phones include a JVM, they are not always heavily used by users (particularly in South Africa). Initially Java applications on most phones typically consisted of menuing systems, small games, or systems to download ringtones etc. However, more powerful phones are increasingly being sold with simple applications pre-loaded, such as translation dictionaries, world clock displays (darkness/light, timezones, etc.) and calculators. Some of these are written in Java, although how often phone owners actually use them is probably unknown.

Microsoft currently ships the .NET Compact Framework that runs on Windows CE and mobile devices, set-top boxes, and PDAs as well as the Xbox 360. Microsoft also provides the .NET Micro Framework for embedded developers with limited resources. Alternatively, Novell licenses embeddable versions of Mono to 3rd parties to use in their devices, and Xamarin commercially distributes the MonoDroid and MonoTouch framework for Android and iPhone development, respectively. Windows Phone 7 uses Silverlight for native apps, but Windows Phone 8 has C# and XAML as the main languages.

Home entertainment technologies[edit]

Java has found a market in digital television, where it can be used to provide software that sits alongside programming, or extends the capabilities of a given Set Top Box. TiVo, for example, has a facility called "Home Media Engine", which allows JavaTV software to be transmitted to an appropriate TiVo device to complement programming or provide extra functionality (for example, personalized stock tickers on a business news program.)

A variant of Java has been accepted as the official software tool for use on the next generation optical disc technology Blu-ray, via the BD-J interactive platform. This will mean that interactive content, such as menus, games, downloadables, etc. on all Blu-ray optical discs will be created under a variant of the Java platform.

Rather than using Java, HD DVD (the defunct high definition successor to DVD) used a technology jointly developed by Microsoft and Disney called HDi that was based on XML, CSS, JavaScript, and other technologies that are comparable to those used by standard Web browsers.

The BD-J platform API is more extensive than its iHD rival, with an alleged 8,000 methods and interfaces, as opposed to iHD's 400.[26] And while Microsoft is pushing iHD's XML presentation layer by including it with Windows Vista, iHD is still a newcomer in a market sector where Java technologies are already commonplace.[27]

However, the fact that the HD DVD format has been abandoned in favor of Blu-ray means that HDi is no longer supported on any optical disc format, making the BD-J format a clear winner.[28]

Runtime inclusion in operating systems[edit]

.NET/Mono[edit]

On Windows, Microsoft has promoted .NET as its flagship development platform[29] by including the .NET runtime in Windows XP Service Pack 2 and 3, Windows Server 2003, Windows Vista, Windows Server 2008 and Windows 7. Microsoft also distributes the Visual Studio Express development environment at no cost.[30]

.NET Framework 3.5 runtime is not pre-installed on versions of Windows prior to Vista SP1, and must be downloaded by the user, which has been criticized because of its large size (65 MB download for .NET 3.5).[31][32]

While neither .NET nor Mono are installed with Mac OS X out-of-the-box, the Mono project can be downloaded and installed separately, for free, for any Mac user who wants to build or run C# and .NET software. As of 13 May 2008, Mono's System.Windows.Forms 2.0 is API-complete (contains 100% of classes, methods etc. in Microsoft's System.Windows.Forms 2.0); also System.Windows.Forms 2.0 works natively on Mac OS X.

C# and the CLI are included and used in a number of Linux- and BSD-based operating systems by way of including the free software Mono Project.[33][34][35]

As a result of inclusion of .NET or Mono runtimes in the distributions of Windows and Linux, non-GUI applications that use the programming interfaces that are common to both .NET and Mono can be developed in C# or any other .NET language and then deployed across many operating systems and processor architectures using a runtime environment that is available as a part of the operating system's installation.[36][37][38] Both Microsoft .NET and the Mono project have complete support for the Ecma- and ISO-standardized C# language and .NET runtime, and many of Microsoft's non-standardized .NET programming interfaces have been implemented or are under development in Mono,[39] but each environment includes many components that have not been implemented in the other.

Java[edit]

Starting with XP SP1a, Windows does not ship with a Java runtime environment.

Java comes pre-installed on all new Apple computers since Mac OS X 10.0. Because Apple maintains the Java runtime for Mac OS X, updates are usually one or two versions behind the versions available from Oracle for the other operating systems, and versions of Java are usually tied to the specific operating system version, so newer Java versions are usually unavailable for older versions of OS X.

Java comes pre-installed with many commercial Unix flavors, including those from Hewlett Packard, IBM and Oracle. As of June 2009, the Debian,[40] Fedora 9,[41] Mandriva[42] OpenSUSE,[43] Slackware extra,[44] and Ubuntu 8.04[45] distributions are available with OpenJDK, based completely on free and open source code.[46] Since June 2008, OpenJDK passed all of the compatibility tests in the Java SE 6 JCK and can claim to be a fully compatible Java 6 implementation.[47][48] OpenJDK can run complex applications such as Eclipse, GlassFish, JBoss, or Netbeans.

The Operating System Distributor License for Java (DLJ)[49] was a Sun initiative to ease distribution issues with operating systems based on Linux or OpenSolaris.

If Java is not installed on a computer by default, it may be downloaded by the user as a Web plugin. The Web plugin process has been criticized because of the size of the Java plugin. Unlike other plugins, the Java download is a full runtime environment capable of running not just applets, but full applications and dynamic WebStart apps. Because of this, the perceived download footprint is larger than some web plugins. However, compared to Java, other popular browser plugins have larger sizes: Java 6 JRE is 13 MB, but Acrobat Reader is 33 MB, QuickTime 19 MB, Windows Media Player 25 MB, the .NET Framework 3.0 runtime is 54 MB, and the .NET Framework 3.5 runtime is 197 MB (it's a united package for x86, x64 and IA-64, each part has approximately 60 MB).

At the JavaOne event in May 2007 Sun announced that the deployment issues with Java would be solved in two major updates during the lifespan of Java 6 (the changes will not be held over to Java 7.) These include:

  • The introduction of a new consumer JRE edition, with an initial 2 Mb footprint and the ability to download the remaining 9 Mb in sections using an on-demand methodology.
  • The development of drop-in cross platform JavaScript code, which can be used from a Web page to install the necessary JRE for a given applet or Rich Internet Application to run, if necessary.
  • An improvement in support for automatically downloading updates to the JRE.
  • support for pre-loading of the JRE, so applets and applications written in Java start up almost instantaneously.

See also[edit]

References[edit]

  1. ^ Results of comparison between jdk15 and classpath
  2. ^ Free and Open Source Java - Project Overview
  3. ^ Sun openjdk: Home
  4. ^ Sun Java 2 Runtime License Agreement
  5. ^ "Open JDK is here!". Sun Microsystems. 2007-05-08. Retrieved 2007-05-09. 
  6. ^ Java Finally Free and Open
  7. ^ Rotor: Shared Source CLI Provides Source Code for a FreeBSD Implementation of .NET
  8. ^ Microsoft and Novell Announce Broad Collaboration on Windows and Linux Interoperability and Support
  9. ^ "Statement on the blog of Mono project leader Miguel de Icaza regarding patent protection for Mono". 2006-11-04. Retrieved 2006-11-06. 
  10. ^ Stallman, Richard (2009-06-26). "Why free software shouldn't depend on Mono or C#". Free Software Foundation. Retrieved 2009-07-02. "We should systematically arrange to depend on the free C# implementations as little as possible. In other words, we should discourage people from writing programs in C#. Therefore, we should not include C# implementations in the default installation of GNU/Linux distributions, and we should distribute and recommend non-C# applications rather than comparable C# applications whenever possible." 
  11. ^ "Microsoft's Empty Promise". Free Software Foundation. 2009-07-16. Retrieved 2009-078-03. "Until that happens, free software developers still should not write software that depends on Mono. C# implementations can still be attacked by Microsoft's patents: the Community Promise is designed to give the company several outs if it wants them. We don't want to see developers' hard work lost to the community if we lose the ability to use Mono, and until we eliminate software patents altogether, using another language is the best way to prevent that from happening." 
  12. ^ a b Microsoft takes on the free world.
  13. ^ Microsoft still open sources more technologies than many think
  14. ^ Microsoft open sources more of its .Net technologies
  15. ^ The F# Software Foundation
  16. ^ .NET Foundation Projects
  17. ^ Xamarin partners with Microsoft to deliver .NET everywhere
  18. ^ Mono-Applications-Aplenty!, OSNews
  19. ^ "Framework Usage Statistics". BuiltWith.com. Retrieved 14 March 2013. 
  20. ^ a b Java EE SDK 5 Update 2 No JDK download page (reference to license agreement)
  21. ^ Mono: ASP.NET
  22. ^ Mono: ASP.NET
  23. ^ Official repository for Razor source code.
  24. ^ Mono: ASP.NET MVC3
  25. ^ Mono 2.12 Release Notes
  26. ^ HD-DVD vs. Blu-Ray, round 2
  27. ^ Format Wars - Blu-ray vs HD DVD
  28. ^ Zaharov-Reutt, Alex (2008-02-21). "Microsoft's HDi interactivity layer loses from HD DVD's death - but does it matter?". itwire.com. Retrieved 2008-08-27. "While many claimed that creating interactivity with HDi was much simpler than using BD-J, the fact that HD DVD will see few future releases beyond 2008 means that, whatever the enthusiasts position on the relative merits of HDi vs BD-J, the BD-J interactivity format is now the winner" [dead link]
  29. ^ Microsoft article that refers to C# as its "flagship" language.
  30. ^ Visual Studio Express
  31. ^ "Dear Microsoft". 2008-01-09. Archived from the original on 2008-02-05. Retrieved 2008-02-03. 
  32. ^ ".Net framework 3.5 size 166MB!". 2007-11-10. Retrieved 2008-02-03. 
  33. ^ Fedora embraces Mono - ZDNet UK
  34. ^ Debian Mono Packages
  35. ^ Wikipedia Uses Mono; Mono Integrated into Ubuntu/Debian - OSNews.com
  36. ^ Fedora Catches Mono
  37. ^ SUSE 10.1 released
  38. ^ Wikipedia Uses Mono; Mono Integrated into Ubuntu/Debian
  39. ^ "Mono – Plans". Retrieved 2008-12-23. 
  40. ^ "Package: openjdk-6-jdk". debian.org. 2009-02-14. Retrieved 2009-02-16. 
  41. ^ Wade, Karsten (2008-03-13). "OpenJDK in Fedora 9!". redhatmagazine.com. Retrieved 2008-04-05. "Thomas Fitzsimmons updated the Fedora 9 release notes source pages to reflect that Fedora 9 would ship with OpenJDK 6 instead of the IcedTea implementation of OpenJDK 7. Fedora 9 (Sulphur) is due to release in May 2008." 
  42. ^ Mandriva Java package
  43. ^ "Package: OpenJDK". opensuse.org. Retrieved 2009-06-01. [dead link]
  44. ^ Slackware Java package
  45. ^ "openjdk-6 in Ubuntu". Retrieved 2008-04-19. 
  46. ^ Reinhold, Mark (2008-04-24). "There's not a moment to lose!". Retrieved 2008-04-19. 
  47. ^ Sharples, Rich (2008-06-19). "Java is finally Free and Open". 
  48. ^ Angel, Lillian (2008-03-13). "OpenJDK to replace IcedTea in Fedora 9". Retrieved 2008-04-05. 
  49. ^ Operating System Distributor License for Java (DLJ)

External links[edit]