Thursday, February 15, 2007

101 Reasons Why Java is Better than .NET (Reloaded)



 



101 Reasons Why Java is Better than .NET (Reloaded)



 


The original edition was put together using a blogging system, this edition
is now based on a Wiki system. Hopefully, the comments and contributions will be
richer this time.


The list is structured such that all 101 entries can be viewed on a single
page (unlike the original!). Each entry would be accompanied by a "sound bite"
that bests captures the intent of the entry (if you got a good one, please let
me know!). Each entry is also a link that you can navigate to examine more
details and supporting information. At this time there is no particularly reason
for the ordering and that will change at a later date (so please don't cite the
entries number when you make an external comment!).


For an easy to remember url to link to this list and all future editions use
101.manageability.org . Feel free to post this url in response to articles and
posts falsely promoting the benefits of .NET.


Finally, for those who unfortunately have legacy .NET deployments, here a
series of articles that will help you migrate to a superior Java platform . 



  • Public Domain APIs - Any Java public apis are part of the public domain,
    .NET apis are proprietary and can open the door to a law suit.

  • Standard Library Source Code Availability - Java source code for the core
    libraries are available in every J2SDK distribution, .NET sources can only be
    seen by resorting to illegal means.

  • dotNet Purity Is A Myth - Java promotes 100% pure Java libraries, for .NET
    purity is nothing more than a myth.

  • 75% Of Enterprise Software Development - Avoid becoming one of the 25% of
    "use-less" employees.

  • Preferred Platform for Implementing WebServices - Despite billions spent
    by Microsoft in marketing, surveys continue to reveal that Java is the
    preferred platform when it comes to Web Services.

  • Superior Platform for Web Development - ASP.NET is a poorly designed and
    crippled framework as compared to the richness of frameworks found in Java.

  • Write Stored Procedures using Java - Most relational databases support
    writing of stored procedures in the Java language. There has yet to be a
    production release of a database that supports any .NET languages.

  • An Abundance of Experienced Practitioners - Nobody seems to know how to
    write .NET programs well and that's giving .NET a bad name! A pretty lame
    excuse I must say!

  • Supportive Open Source Communities - Open Source communities that support
    distributed development are a plenty in the Java world.

  • Proven Security - 2 Years after Trust Worthy initiative is launched and we
    collectively lose $55 billion last year.

  • No Lizard Brain - .NET programmers continue to struggle with the
    complexities of a hybrid managed/unmanaged environment.

  • More Languages - The JVM is more "common" than the CLR.

  • Smaller Runtime Download - You can't run your app if you don't have the
    runtime.

  • No Mandatory Upgrade Fees - 3 things a Microsoft shop can't avoid: Death,
    Taxes and License 6.

  • More Vendor Choices - .Net is a marketing program. Java is a Market.

  • Industrial Strength Collection Classes - The .Net libraries look like they
    were designed by high-school students, First year CompSci? students at best.

  • FutureProof - The way to ensure your return on investment (i.e. ROI) is
    that your choice of platform doesn't get obsolete in 5 or even 10 years. Avoid
    the Microsoft upgrade treadmill!

  • Larger Talent Pool - Majority of Universities not only teach but require
    knowledge of Java. That's a big talent pool that you need to consider before
    you off-shore your project to a different time-zone.

  • More Contributions From Researchers - Research institutions and
    universities have consistently provided innovative research not only built on
    top of Java but also contributing to Java.

  • US Government Approved - Guess where the billions of dollars spent on the
    U.S. government's IT renovation is going to?

  • NoEvilTypeCoercion - Some C++ constructs are meant to be entombed forever,
    .NET resurrects them with disastrous consquences.

  • More Mature And Robust O/R Mapping - You can't beat the wealth of O/R
    mapping solutions found in Java.

  • Superior Coding Tools - Like having your own personal Java fairy dancing
    through your code, anticipating your every thought and keystroke.

  • Sane Coding Conventions - I don't know what's worse Hungarian notation or
    .NET coding conventions.

  • Higher Paying Jobs - Somehow you've got to afford those skyrocketing
    housing prices don't you?

  • Favored for Implementing P2P - Gnutella and JXTA, anything else legally
    more pervasive?

  • PureJavaRDMS - Can't beat the ease of installation when the RDMS is Java
    based and packaged with the application in a .zip file.

  • More Exception Handling Options - .NET has no analog to the throws clause
    in method signatures.

  • Better Structured Diagramming Frameworks - When going beyond forms and
    windows, Java can't be beat.

  • Reusable Open Source IDE Frameworks - Why re-invent the wheel? Start
    building your killer GUI application on top of killer IDE frameworks.

  • RobustParserGenerators - Want to build a new language, well you'll need
    some robust parser building tools.

  • AspectOrientedProgramming - The next advance in modular software
    development, get a head start by using Java.

  • PureJavaWebServers - Customizations and extensions are easier in a web
    container that's built using the same language as applications. Furthermore,
    managed environments support better reliability and security.

  • OpenSourceJavaCompilers - Your tools have got to be able to parse the code
    before it has any chance in understanding it.

  • Distributed Caching - Sometimes embarassingly parallel applications aren't
    the only things that you need to scale.

  • MultipleReliableMessagingChoices - Java provides more choices for the
    backbone that integrates the Enterprise.

  • Faster Development Turnaround - Incremental compilation is unavailable in
    the .NET environment.

  • Lightweight Persistence - Sometimes a relational database (RDMS) has too
    big a footprint.

  • Open Community Process - How does one contribute to the specification of
    standards?

  • Hardware Accelerators - Performance boosting hardware.

  • More Flexible Licensing Options - Ultimate flexibility in licensing.

  • EmbeddedDevices - Java inside small packages.

  • Faster Virtual Machines -

  • MickrokernelArchitectures

  • ContinuousBuild

  • WholeProgramOptimization - Please sir may I have a linker?

  • Comprehensive RDMS Driver Support - Can you find a ADO.NET driver for an
    open source database?

  • Superior Code Analysis Tools

  • NetworkingSupport - Why is MSN managed by a Java based tool?

  • More Garbage Collection Options

  • ReliabilityConcerns

  • Better Web Services Interoperability

  • Better Domain Specific Languages Support

  • Painless Upgradability

  • Simple Side By Side Execution

  • More Business Rules Engines

  • Lightweight Containers

  • Better Business Process Management

  • Sixty Four Bit Support

  • Millions Of Java Phones

  • Garbage Collect Classes - The only way to unload MSIL code is to unload an
    entire application domain.

  • More Alternative VM Implementations

  • Hard Realtime Capabilities

  • Cross Platform Language Integration

  • More Extensive XML Support

  • Better Support For Dynamic Distributed Systems

  • Superior 2D Drawing

  • Better GUI Framework - Why isn't VS.NET written in a .NET language?

  • SuperiorBranding

  • No Anti Open Source Agenda

  • Standardized Portal Frameworks - Standardized ""Integration at the
    glass"".

  • RunInIntepreterMode - ""We're just not optimized for interpreting""

  • More Semantic Web Research

  • Leads In Software Process Best Practices

  • Better Concurrency Utilities

  • More Multicasting Libraries

  • Superior Refactoring Tools

  • Higher Demand Therefore More Jobs

  • Faster And More Reliable Regex

  • SuperiorBuildEnvironments - A .NET practitioner's concept of a build is
    F7.

  • Embarassingly Rich Information Sources

  • More Open Source Projects

  • Affordable Industrial Grade IDEs

  • Standardized Enterprise Connectivity

  • DynamicLanguagesSupport

  • MorePDASupport - Why limit oneself to a single PDA brand?

  • OpenTechnologyRoadmap - .NET is like a five year plan in the former USSR:
    You know it doesn't actually make sense or help anything, but if you live
    under it, you're certainly not going to say anything negative about it.

  • EmergingStandardsSupport

  • JavaCard - JavaCards? are becomming the preferred method of keeping tabs
    on your citizenry or customers. If Microsoft ever co-opts this technology then
    "1984" will become more than just a paperback novel.

  • Complete Open Source Stack - Open Source code visibility spanning all
    layers of an application.

  • NonStopServers - .NET not fault-tolerant enough for
    Hewlett-Packard-Compaq?

  • Out Of This World - Java runs on other planets, .NET has yet to leave
    Terra Firma.

  • Better Unit Testing Support - More extensions and comprehensive IDE
    support

  • More Identity Management Solutions - Can you trust Microsoft to keeping
    your customer's identity secure and available?

  • Most UML Tools Implement In Java - Ever wonder why the best UML tools are
    implemented in Java?

  • More R&D On Intelligent Agents - Java is the preferred implementation
    platform for Intelligent Agents.

  • Easy Rich Client Deployment - No-Touch development was shaky.

  • Lower Cost for Massively Parallel Systems - How much does it cost to
    deploy a .NET application on a platform with 10,000 servers like google?

  • More Profilers - Profilers mitigate the risk of not finding the root cause
    of show stopping bugs.

  • Eclipse

  • OneHunderedReasons


  • Wednesday, February 14, 2007

    How to make a jar file in java ?

    How To Make A JAR File


    JAR files are Java's version of ZIP files. In fact, JAR uses the ZIP file
    format. There are two main uses for JAR files which I shall explain here. The
    first use is to compress (make a smaller size) a number of files into one file
    (archiving). The second use is to make a Java executable JAR file.






    Compress Files To A Java Archive (JAR)


    This is by far the most common use for JAR files: to compress multiple files
    into a single JAR archive. JAR files can be opened with
    WinZip or
    WinRar
    . In terms of Java applications, the ability to archive any number of
    source or class files into one single archive represents the biggest advantage -
    distributing one file containing hundreds of files is so much easier than
    distributing hundreds of files separately!

    The jar utility program is run
    from the command line (DOS prompt or bash for example, depending on your OS).
    Here is how to create a compressed JAR file:
       jar cf archive_name.jar files

    Let's look at each part of that command line.
    jar

    The command to run the jar utility.

    CF

    Create a new archive with the file name specified. These two options are
    from this list of common options:

    - c create new archive
    - t list table of contents for
    archive
    - x extract named (or all)
    files from archive
    - u update existing archive
    - v generate verbose output on
    standard output
    - f specify archive file name
    - m include manifest
    information from specified manifest file
    - 0 store only; use no ZIP
    compression
    - M do not create a manifest
    file for the entries
    - i generate index information
    for the specified jar files
    - C change to the specified
    directory and include the following file

    Multiple options can be used together. They all must appear after the "jar"
    command with no white space separating them.

    archive_name.jar

    Name of the JAR file. This can only be included if you use the 'f' option.

    files

    Names of all the files you want to put in the jar file. This could be just
    one name or a list of multiple names separated by space. Names can use pattern
    matching characters to match multiple files.






    Common Examples


    Let's say I have a Java application consisting of three source files that I
    wish to distribute:

    One.java 
    Two.java
    Three.java


    I also want to call my JAR file
    example.jar
    . To make a JAR file with just
    One.java:
       jar CF example.jar One.java

    To make a file with all three files listed separately:
       jar CF example.jar One.java Two.java Three.java

    To make a file with all three files using a pattern match:
       jar CF example.jar *.java

    It goes (almost) without saying that the source files are in the same
    directory you are running the jar command in.








    Compress Files To An Executable Java Archive (JAR)


    It is also possible to make an archive that can be executed (run) by Java and
    even by a double click through your OS, if you have it set up correctly. Of
    course, to do this you must store compiled class files in the archive, as well
    as or instead of Java source files, since Java source files cannot be run!

    Continuing the example above, I now compile my Java source files:
       javac *Java

    or
       javac One.java Two.java Three.java








    Create An Executable JAR


    All JAR files contain something called a manifest file which holds
    information Java wants to know. One piece of information a manifest file may
    contain is the name of a class that will be run if the JAR file is executed.

    The first thing you must do is create a text file that lists the "main" class
    - the class that has the main method you want executed when the JAR is executed.
    Let's say that Three from the
    above example has the main method I want executed. I create a text file called "mainClass.txt"
    with the following text:

    Main-Class: Three

     


    IMPORTANT: the text file only needs the one
    line of text for this purpose. However, the file must end with a blank
    line or this will not work, ie the file has two lines in it - the second one is
    empty. Note too the class is called "Three" and not "Three.java" (the
    file containing the source code) or "Three.class" (the file containing the byte
    codes). If your class file is in a package hierarchy, you must use the fully
    qualified name of the class (eg "myPackage.MyClass").

    I then run the jar utility with this command line:
       jar cmf mainClass.txt example.jar *.class

    With this line, I told jar to create a JAR file (option
    c) with modifications to the
    manifest file (option m) as
    specified within mainClass.txt,
    naming the JAR file (option f) as
    example.jar and including
    everything that matches the pattern
    *Class









    Running An Executable JAR From Command Line


    I can run it from the command line like this:
       java -jar example.jar






    Running An Executable JAR From Explorer (Windows)


    Within Windows, it is also possible to set up Windows Explorer so that you
    can double click on the JAR file icon to execute the file (handy for GUI
    applications). The first thing you must do is set up the correct association
    with the 'javaw.exe' application that JDK for Windows will have.

    If there is no JAR file type, create it. Give it a description like
       jar - Executable Jar File

    to ensure it sorts under 'jar'. Create or edit the action called "open" and
    associate it with the following action:
       "C:Javajdk1.4.0binjavaw.exe" -jar "%1"

    Of course, you will replace "C:\Java\jdk1.4.0\bin\javaw.exe" with whatever
    path is correct on your machine.

    IMPORTANT: include the double quotes to take
    care of names with spaces.