Slashdot Mirror


Java SDK 1.5 'Tiger' Beta Finally Released

kingkola writes "Finally, after about two years of development, the Beta for Java SDK 1.5, aka Tiger, has been released. Features added in this edition include generics support, autoboxing of primitives, syntactic sugar for loops, enumerated types, variable arguments, sharing of memory between multiple VMs and a bunch of other bugfixes, enchancements, etc."

21 of 602 comments (clear)

  1. For more information check out theserverside.com by alenm · · Score: 5, Informative
  2. Re:Why? by jimbolaya · · Score: 5, Interesting
    Java is probably the most popular language today; undoubtedly within the top 5. And the Java-is-slow-C-is-fast myth is just that...a myth. Dynamic recompilation (HotSpot) in modern Java Virtual Machines can actually make Java as fast or faster than C. And forget not that you can write a slow program in any language, C included.

    What Java is is a memory hog. "Hello World" can easily consume a megabyte of RAM. The shared memory will help this situation. (Incidentally, the shared memory idea was originally developer by Apple for Mac OS X. Apple worked with Sun, and donated code, to make it universal).

    --

    There ain't no rules here; we're trying to accomplish something.

  3. IPv6 for windows finally by goodbye_kitty · · Score: 5, Insightful

    Yay, finally some proper java support for IPv6 in windows. Im not an IPv6 zeaolot or anything but its great to be able to write (careful) java.net code using generic InetAddresses and be pretty sure that it will work regardless of which version of IP your network is using.

    1. Re:IPv6 for windows finally by Anonymous Coward · · Score: 5, Informative

      Why finally? For Java to support IPv6 on Windows, MSFT had to support it first and that didn't happen until Windows XP SP1.
      Now that being said, the really cool part about Java supporting IPv6 on windows is that it actually makes it much, much easier for developers to add support for IPv6 on Windows. You see, Microsoft didn't provide a dual stack implementation which means an IPv6 socket can not talk to an IPv4 host. It's stupid and contrary to what the RFCs strongly recommend. So if you're a .Net developer and want to support IPv6, you're in trouble as you have to rewrite your application to handle both kind of sockets, not too hard for client side, much more of a pain on the server side.
      Now, with Java, none of that, a Socket is a Socket and that's it. To make it better, chances are your Java application doesn't need to be modified, or even recompiled! Imagine that: your application was already IPv6 enabled and you didn't know it.

  4. Re:Why? by Jim_Hawkins · · Score: 5, Insightful

    It bothers me when I read statements like this. Maybe Java is slower than C -- it really depends on what you are doing with each language. For example, heavy duty graphics are not going to fly in Java. However, the portability that a language like Java has, the ease that it can be implemented and the support that it is gaining/has gained in the corporate world makes it a solid competitor.

    Every language out there has its own advantages and weakensses. C is fast. It is powerful. The gaming industry will probably always continue to use it unless something exceedingly better comes along.

    Java is stable. It is secure. It is very easy to code. Web developers and businesses looking to get multiple systems working together quickly and efficiently will continue to use that.

    I don't pretend to be an expert, but from what I've seen, Java is definitely a good thing to have around.

  5. Re:Too little, too late by sporty · · Score: 5, Informative

    generics support

    C# innovated this, and already has this in the spec


    C++ had this way before. Next...


    autoboxing of primitives

    C# innovated this, already implemented years ago


    Ruby.. next...


    syntactic sugar for loops

    "foreach": C# innovated and already has this, implemented years ago


    Perl...


    enumerated types

    Java didn't have this before? LOL


    No, and not always very useful. It's just neat.


    and a bunch of other bugfixes, enchancements

    Bugfixes in a language? WTF?


    In the VM or in the java support classes library, i.e. j2ee.jar

    --

    -
    ping -f 255.255.255.255 # if only

  6. Re:Too little, too late by kinga · · Score: 5, Funny


    Grennis: C# innovated!
    Inigo Montoya: You keep using that word. I do not think it means what you think it means.

  7. Re:Too little, too late by LordK2002 · · Score: 5, Informative

    C# did not "innovate" any of these. It might well have implemented them before Java, but most of them were available in various programming languages long before C# arrived on the scene.

  8. About time too by DrXym · · Score: 5, Interesting
    This finally puts Java the language onto the same level as c#. While most of the syntax changes amount to sugar (the compiled code being the same), it is still welcom to see a proper enum at last. And things like generics should make it considerably less tedious to walk through collections (a bane of Java development).


    Another change that caught my eye was a skinnable theme for JFC called Synth. I wonder if this will help Java capture some of the kewl market for media players etc.


    I also see the beta is being made available for 64-bit Linux.


    As a platform, Java is still miles ahead of c#. But I sometimes wonder if the message is lost amongst all the specifications and implementations of specifications. The .NET strategy has gotten some ill-deserved 'buzz' from managers who've heard the spiel without quite understanding the implications if they go that route (i.e. lock-in). Someone in Suns marketing department should produce a massive wallchart detailing everything Java can do, every major solution for it and arrows showing how they all join together and then mail it out to every CEO / CTO in the country.

    1. Re:About time too by Glock27 · · Score: 5, Insightful
      How is java less lock-in than ,NET?

      Because Java has freely available, industrial strength implementations on dozens of platforms. If you use it, you aren't locked in to deploying on any particular OS or hardware. (BTW, don't forget gcj in your list of "free" alternatives.)

      .Nyet, on the other hand, leaves you with only Windows as a deployment option - it's not at all clear that Mono will be allowed to finish/distribute a complete cross-platform .Net implementation. Many important libraries aren't in the ECMA standards, such as Winforms.

      I hope that helped clear things up...

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    2. Re:About time too by severoon · · Score: 5, Informative

      This is one of the most misunderstood aspects of the C# vs Java debate.

      If you write code in Java, you can run the same compiled class files on any platform. In C#, any code you write MUST run on a Windows-supported platform under Windows, but because every .NET language compiles to the CLA (Common Language Architecture), they are all translated into a single, compatible language before going to bytecode. Meaning, you can interoperate between any .NET language, have C# functions call a C++ function (assuming C++ is a .NET supported language now or someday) and just have it work...no CORBA, no distributed programming, etc. Furthermore, the CLA common language provides stuff like garbage collection so you can neglect free() and delete() in C++ and not worry about memory leaks (just don't compile that code with a non-.NET C++ compiler). The grand vision here is that everyone using .NET is locked into the .NET framework running on a Windows platform. There's nothing open about that.

      sev

      --
      but have you considered the following argument: shut up.
  9. Re:Too little, too late by MSBob · · Score: 5, Insightful
    C# innovated this, and already has this in the spec

    Bollocks to that. C# copied generics from C++ (which likely copied it from somewhere else) and so did Java. And they both (C# and Java) got it wrong and missed the point.

    Java didn't have this before? LOL

    Lack of enumerated types in Java has been a real pain in the ass as was lack of typedef.

    Memory sharing between VMs is not so easy to do when you have umpteen platforms to support. Much easier when you have one like in .net.

    What .net lacks however is more substantial. There is no API in .net for doing O/R mapping such as JDO or CMP (belch). There is no API for distributed clustered components like EJB session beans. MSMQ is only usable in the Microsoft world. JMS queues can generally be used to integrate with legacy systems. Java has a bunch of great open source tools for it like Eclipse and all its plugins not to mention the Jakarta project. .net has bugger all for a developers' community, unless you consider Microsoft's astroturfing a vibrant community.

    Finally .net lacks real credibility in the enterprise. The company that I work for (biggest consulting shop in North America) has a strategy of using .net for quick several week hack jobs but the real projects are always done with J2EE.

    --
    Your pizza just the way you ought to have it.
  10. Code Examples by Dreamland · · Score: 5, Informative

    Here's a very nice PDF giving actual code examples of the new language features:


    http://www.javasig.com/Archive/lectures/JavaSIG- Ti ger.pdf

  11. Saves loads of code by cerberusss · · Score: 5, Interesting
    What is great about this, is that this saves loads of code. Lots of explicit typecasts can be left out now, there is a very short-handed for-loop, you can import constants, etc. etc.

    I played with the alpha and gave a presentatation about it at my employer. Lots of people were enthousiastic.

    Plug: java-1.5_new_features_en_v2.ppt

    --
    8 of 13 people found this answer helpful. Did you?
  12. Re:"generics" by PhrostyMcByte · · Score: 5, Insightful

    The type checking is much weaker thus introducing new potential holes for error to slip through.

    In collections, generics make type checking much stronger. They allow you to find casting problems at compile time instead of run time by not boxing things to Object and back. This also gives a huge speed increase (about 300% in my tests).

  13. In Response to C#? by osewa77 · · Score: 5, Insightful

    When I first learnt Java, I was so excited about the write once read anywhere functionality but many language features (or the lack thereof?) simply bugged me. Then I discovered C# and was happy to have found a usable Java - until I saw the probs Mono is facing porting .NET, particularly System.Windows.Forms, to Unix ... and the fact that they would always have toplay catch up, with no big company to support them (IBM, Sun and other Linux/Open source backers already have a huge stake in Java)

    When I read about the proposed features for Java 1.5, I knew i could stick with Java for the long term. Good news!

  14. Just a Question for everybody: by nberardi · · Score: 5, Interesting

    I don't want to start a flame war, but do you think that the pressure of .Net pushed some of these features through that Sun seemed to be holding off on for the longest time.

    Such as enums, generics, boxing, foreach loop, etc.

    Just a question that I have had, because I never heard anything about these features comming into Java until after .Net made it's comming out in 2002.

  15. Where the value is by lonb · · Score: 5, Insightful
    While I see people here immediately start debating who gets credit for various aspects of the language and when things came out first -- in hopes of finding which originator is the more powerful geek (MS or SUN), I think the critical point is being missed.

    Microsoft has it REALLY easy, and is cut way too much slack, when it comes to development environments and languages. They control the operating system and the hardware specifications and compliance. And, they have done so for well over a decade.

    Java is truly platform independent, which is a huge challenge. That challenge was met with a well designed language that operated slowly. However, between 1.4 and 1.5 there are substantially speed increases in the VM which bring it up to par with the fastest languages available.

    When you think about developing applications you need to consider many things other than pure technology:
    - Who will be around in 5-10 years (both MS tech and Java tech will)
    - Access to developers (while MS is the clear winner in the US, this is not so in other countries, where even gov'ts are against MS)
    - Vendor independence and support (this is clearly in favor of Java)
    ..the list goes on.

    --
    "Ain't I a stinka..." - Bugs
  16. "enchancements" by tehcyder · · Score: 5, Funny

    Is it just me who loves that typo?

    --
    To have a right to do a thing is not at all the same as to be right in doing it
  17. About polymorphidm snd subtyping by fab13n · · Score: 5, Informative
    Let's state that A <: B means "A is a subtype of B". Now the question is "What do I need as conditions on As and Bs to get A<As> <: B<Bs>". The answer is:
    • If one can only read values of type C with A methods, then the relation is covariant, i.e. to get A<As> <: B<Bs> we need As <: Bs.
    • If one can only WRITE values of type C with A methods (e.g. pass them as function parameters), then the relation is contravariant, i.e. to get A<As> <: B<Bs> we need Bs <: As. Counter-example:
      Int &lt;: Float

      Array&lt;Float&gt; a0= new Array&lt;Float&gt;();
      a0.[0] = 3.14159;
      Array&lt;Int&gt; a1 = a0; // would be legal if the type was covariant
      Int x = a1[0]; // Oops, I've put a float in an int.
      // I shouldn't be allowed to do that without an explicit cast.
    • If parameters of such types can be both read and written, then you need both As <: Bs and Bs <: As, i.e. As == Bs. That's what happens with java. If you want your structures to be covariant, you have to forbid their modification (here, forbid to change the cells' contents).
    If in some exceptionnal cases you want to enforce subtyping, it's up to you to use casts. But you cannot assume a bogus subtyping relationship without noticing it, therefore the type system did its job.
  18. Re:an annoying quirk by derkaas · · Score: 5, Informative
    You can, however, make use of wildcards to define a covariant inhertiance relationship between ArrayList<Number> and ArrayList<Integer>. We can reconstruct your example to create this relationship:
    ArrayList<Integer> s = new ArrayList<Integer>();
    ArrayList<? extends Number> t = s; //compiles

    Check out this paper for information about this other kinds of variance available in Tiger.