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."

34 of 602 comments (clear)

  1. 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.

  2. an annoying quirk by Dogun · · Score: 3, Interesting

    A friend of mine is bitching about this: if you type a list, say ArrayList, you can't use that as an argument for a function that takes a ArrayList. He's tried casting it, it just doesn't like it. Anyone else seen something like this?

    1. Re:an annoying quirk by Prior+Restraint · · Score: 2, Interesting

      Like everyone else on Slashdot, TheSunborn didn't preview before posting, and lost a bunch of angle brackets that might have caused the post to make some kind of sense.

      Or, maybe s/he's crazy.

  3. 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 Seahawk · · Score: 3, Interesting

      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).

      How is java less lock-in than ,NET? Both are closed products with free alternatives. Java has Kaffe, lots of small jvm's and classpath - .NET has Mono.

      In my eyes you are about equally locked in - but people tend to hate .NET just because its MS.

      My view is that c# is a bit more "clean" as a language, but the classlibrary is much more immature than the java classlibrary.

    2. Re:About time too by Haeleth · · Score: 2, Interesting

      it's not at all clear that Mono will be allowed to finish/distribute a complete cross-platform .Net implementation

      While the immaturity of Mono is the reason I'm looking into Java rather more seriously than .Net at the moment, I would like to point out that it's also not at all clear that there's anything Microsoft can do to stop Mono.

      Remember that the only potential legal threat to Mono is Microsoft's patent portfolio. But even if Mono is infringing on something - and I haven't seen any evidence that it is - Microsoft do not have an extensive record of using patents aggressively. Their basic tactic has always been "embrace, extend, extinguish" - not "steal, sue, squash".

      So the main threat to Mono is that the target will keep moving, not that Microsoft will try to crush them. But Microsoft will not be able to break .Net in too many incompatible ways without alienating their customers. And unlike SCO, Microsoft's business model relies on keeping their customers happy.

    3. Re:About time too by Seahawk · · Score: 2, Interesting

      I have been a C# developer for a year and a half - and damn its frustrating to reverse engineer MS libs, because the damn thing is poorly documented.

      But look at one of my other answers :)

      And personally I love java - and has for about 6 or 7 years...

    4. Re:About time too by Tal+Cohen · · Score: 3, Interesting

      Not true: If Sun drops dead, Java will live on with interested parties such as IBM and Oracle. Their agreements with Sun are such that Sun cannot simply pull off the product and prevent further development.

      --
      - Tal Cohen
    5. Re:About time too by Uksi · · Score: 3, Interesting
      In C#, any code you write MUST run on a Windows-supported platform under Windows


      That's not correct. Next time, please say "according to blah, ...". For example:


      According to the Mono faq:


      Question 58: Can I develop my applications on Windows, and deploy on a supported Mono platform (like Linux)?


      Yes, you can.


      As of today, Mono is not 100% finished, so it is sometimes useful to compile the code with Mono, to find out if your application depends on unimplemented functionality.



      So in short, yes, you can compile C# and C++ to bytecode under Windows and run it under Linux.

      Although what you said about CLA (being able to call other languages' functions) is correct.
  4. 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?
  5. Exactly by FatSean · · Score: 2, Interesting

    Linux, AIX, Windows. We can develop our J2EE apps on any of these platforms and they 'just work' on the other 2 with no extra work. It's glorious. Ever try to cross-compile a non-trivial C/C++ program. Yuck.

    --
    Blar.
  6. Benchmarks by SashaM · · Score: 4, Interesting

    Actually, 1.5 beta has been available for a few months now, but the link wasn't on the main java.sun.com page.

    Here are some highly unscientific benchmarks of startup time I just ran on my Athlon XP 2000+ under Mandrake 9.2:

    [sasha@jupiter tmp]$ time -p /usr/java/1.4/bin/java HelloWorld
    Hello World!
    real 0.30
    user 0.22
    sys 0.03

    [sasha@jupiter tmp]$ time -p /usr/java/1.5/bin/java HelloWorld
    Hello World!
    real 0.17
    user 0.16
    sys 0.02

    These are relatively consistent over multiple runs.

  7. Re:Too little, too late by Anonymous Coward · · Score: 1, Interesting

    >>>generics support
    >>C# innovated this, and already has this in the spec
    > C++ had this way before. Next...

    C++ does not have generics, it has templates, which are quite different. Templates cannot be verified when they are compiled, only when they are instantiated. Generics can be verified when they are compiled, so when they do compile you are guaranteed that they will work for any instantiation. Also, generics (in the MS implementation, at least) do not duplicate code as much as templates: methods that can use the same instructions because the instructions do not depend on the actual type share the same code.

    >>>enumerated types
    >>Java didn't have this before? LOL
    >No, and not always very useful. It's just neat.

    I do not think there are may people that share that view; I certainly don't. Defined constant integers take more typing to enter, they cannot be reflected over as a unity (as they aren't), and they are not type safe.

    I do agree with you that most items in the grandparent post are no innovations, but they sure are nice to have.

  8. The good and the ugly by brett_sinclair · · Score: 4, Interesting

    I really like the new language features (and will use them in about 5 years when our server is upgraded :-().

    But Swing is even uglier than before. Metal still looks very old, but now it looks like someone very old with obscene amounts of make-up on.

    The GTK+ look is even worse. It doesn't look like GTK+ at all (I'm not even sure whether it's supposed to be GTK1 or GTK2).

    Worse: font rendering is abysmal. Buttons and menus are barely readable using the GTK+ emulation L&F. The Java VM still doesn't use Xft/Freetype, which pretty much makes the attempt at GTK+ emulation useless.

  9. Re:Too little, too late by AbbyNormal · · Score: 2, Interesting

    As much as anyone loves a good berating of a pro-Micrsoft poster, I think both posters missed some relative points.

    While the parent mod, loved to cite counter example of technologies utilized previous to C#, I think he missed a good point. C# was the first to pull ALL of these things together under one hood and they did so a few years ago. Don't get me wrong, I'm a java (mainly) and .NET developer, but I choose the right software for the right job . I'm glad to see Java stepping it up a notch, I just hope that it is not too late.

    --
    Sig it.
  10. 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.

  11. Excuse me but: by gargleblast · · Score: 4, Interesting
    1. The type checking is much weaker than what? It is perfectly strong at runtime.
    2. Verifying the correctness of any program in any Turing-complete language is in general impossible
    3. The reusability "argument" of OOP is rubbish too.
    4. The abovementioned problems are nonsense and as such create nothing. In addition, the banking sector is not universally regarded as sensible.
    5. You must be thinking of C++ templates which are (1) Turing complete and (2, coincidentally) are a significant burden to the compiler and linker. Java's generics are neither. They are a simple syntactic sugar for type casting. C++ with templates is still LALR(1)/Context-free/Chomsky type 2. Chomsky hierarchy has nothing whatsoever to do with secure correctness checking. If a language is Turing complete, there is in general nothing you can prove about it's programs.
    6. In my limited experience with Lisp's authorities, they encourage much and discourage little. Provide a citation please.
  12. What about HttpSession objects? by UCRowerG · · Score: 2, Interesting

    I know the compile-time checking for things like ArrayList is a good thing, but is there any note on how this may impact things like HttpSession or HttpServletRequest attributes, where different data types are essential?

  13. Someone please make a debian package! by Doug+Neal · · Score: 2, Interesting

    I'm still stuck on 1.3 due to the Blackdown JVM's Debian package not being updated for 1.4. I could do it non packaged-managed, but I'd really rather not...

  14. C is portable too by sreitshamer · · Score: 2, Interesting

    It bothers me when Java's portability is extolled. C is portable too, to more platforms than Java is. And the system call libraries on most platforms have C interfaces, not Java. The only interactions with the host OS that Java supports natively are through the weak File and System objects, through which I can only get the most generic information. For everything else I have to use JNI and, you guessed it, C.

    Java's only better if you don't know what you're doing (you can't have pointer bugs, for instance). C and C++ are better when you want to build your language constructs from the bottom up at the same time that you write your program from the top down.

  15. Class Data Sharing comes from Apple by Arkham · · Score: 4, Interesting
    One of the new features, Class Data Sharing, comes as a contribution from Apple. On the Apple Java Page, Apple describes this feature as:
    On other platforms, each Java application consumes some system memory, so you might end up using more memory than you need to when running multiple Java applications. Other languages, such as C or C++, solve this problem using what's called shared libraries. Apple developed an innovative new technology that allows Java code to be shared across multiple applications. This reduces the amount of memory that Java applications normally use. And it fits right into Sun's Hot Spot VM, allowing Mac OS X to remain compatible with standard Java. In addition, Apple has given this implementation to Sun so the company can deploy it on other platforms. It's just one example of how Apple supports standards and shares ideas to benefit all.
    Pretty cool stuff, and it shows that Sun does accept changes to Java from the outside that are of clear benefit.
    --
    - Vincit qui patitur.
  16. Good News for SwingSet by Yoda2 · · Score: 2, Interesting
    This means that the Java RowSet for JDBC is now a semi-standard part (still a sun.* package) of the JDK and no longer requires a Early Access Developer download.

    Our open source SwingSet toolkit for making the Swing components database-enabled/aware will now be much easier to install/distribute. Hooray!

  17. Can we thank .NET for giving Sun a push? by alien_blueprint · · Score: 3, Interesting

    Sun have been promising generics for Java since 1997, and I have been patiently waiting for it all this time.

    I haven't had the chance to look at C# in detail yet, but it's certainly no co-incidence that these features finally saw renewed activity after C# appeared. So, thanks, MS, for applying a little competitive pressure onto Sun for us :)

    I'm also a little disappointed to see just how similar Java generics are to C++'s templates. I was hoping that we were waiting for a *reason*, and that reason might be because it was a new and interesting approach. But, at least superficially, this looks almost exactly like C++ templates, with all the positives and negatives that go along with that.

  18. Screen Shot by Yoda2 · · Score: 2, Interesting

    Here's a screenshot of my EBLA project using the new default look & feel and the new SwingSet navigation bar.

  19. Re:steps toward Python by Anonymous Coward · · Score: 1, Interesting

    Python is not weakly typed. It is dynamically typed. But you knew this, and just made an honest mistake because you do real work. ;)

    If python was 'weakly typed', you could do this -

    foo = 5
    bar = "duh"
    foo = foo + bar
    ... but you can't, because it raises a (gasp) type error! Just as a comparison, consider C -

    int foo = 5;
    char* bar = "duh";
    foo = foo + bar; /* perfectly valid */

    (before I get flamed, yes, I _know_ this is nonsense, so was the python example - the point is python complains, C doesnt. Btw, the C example is not valid C++ code (C++ has stronger typing semantics))

    I personally find static typing to be relatively useless. It basically is only useful for optimization purposes. By knowing the type at compile-time, certain optimizations can be made. But, we all know that "premature optimization is the root of all evil" ;)

    The best compromise is to allow both typing schemes - dynamic, unless specifically statically typed. That way, if I determine a bottleneck is due to dynamic typing, I can use static typing. Now that is something I would like to see in Java.

  20. Re:Too little, too late by teromajusa · · Score: 2, Interesting

    "I think he missed a good point. C# was the first to pull ALL of these things together under one hood and they did so a few years ago."

    I think you in turn missed his point. The post he was replying to claimed that C# had innovated these features. He was demonstrating that those features had in fact existed in other languages previously.

  21. not enough by ajagci · · Score: 4, Interesting
    These are language fixes that should have happened years ago. The real question is: why did it take Sun so long? Why is the process by which the Java language evolves so severely broken?

    And many serious problems remain with the Java language:
    • Java genericity has no special support in the runtime, which limits the type safety it can provide.
    • Generics over primitive types are boxed, meaning they are inefficient.
    • Java's native code interface is still inefficient and complex.
    • Java still lacks value classes and operator overloading, making it a poor choice for applications involving numerics or graphics.

    The most serious problem with the Java platform is and remains, however, that it is basically proprietary: all Java 2 platform implementations depend crucially on code licensed from Sun (e.g., there is no independent Swing implementation). Furthermore, there doesn't exist a Java standard that people can implement without having legal constraints imposed on them by Sun.
  22. Re:Too little, too late by AbbyNormal · · Score: 2, Interesting

    No...Please re-read my post. I never claimed C# innovated anything...I said they were the first to put them all under one roof.

    --
    Sig it.
  23. Re:Nice First Step, But.... by netnichols · · Score: 2, Interesting

    All the java products you mention are free. How much does VS.NET and IIS cost?? I do agree that for 'visual stuff' (ie. guis) ms development tools are still ahead.. but with the rate of innovation in the java world.. they won't be for long.

  24. Re:Nice First Step, But.... by Anonymous Coward · · Score: 1, Interesting
    Sounds great for you. And I am also guessing the stuff your building is really a simple display of a single database table or at most a view of a few tables joined. For this kind of stuff, it's great if you don't want to think about performance or anything other than getting the job done. This is also exactly the job that will get outsourced.

    If you need anything moderatly complex like say, push database updates to a smart cache in your webserver, doing it in .NET will require writing lots of custom code. Whereas using Resin, it's already built in and is easy to use. People should get over the whole technology thing and do what makes the most sense. I develop with .NET as my primary job and I have to say, we've practically rewritten and over-rided the default webservices mechanisms. This isn't because we like to re-invent the wheel. It's because we're building apps that are moderately complex and the basic stuff doesn't cut it. If I had to build the same thing with a servlet container, I can honestly say, it would have been done 5 months ago. We still have many months left in our dev cycle to replace more stock stuff, so that we can get the functionality we need.

  25. The biggest problem with compatibility... by s88 · · Score: 2, Interesting

    will be code like this:

    Enumeration enum = collection.elements();
    while(enum.hasMoreElements ()) { ...
    }

    Guess what... that is a compile error now. "enum" is a new keyword, and is no longer valid as a variable name.

    Scott

  26. Re:Code is for compiling and running by Anonymous Coward · · Score: 1, Interesting

    Obviously, you work alone, or your co-workers that have to maintain your code hate you.

    Code is not just instructions for a computer, it is a form of communication between developers that tells of the problem domain you are solving.

    The code below does the same thing. The first is faster to write. Which would you rather have to maintain?


    X = X - XX;
    XXX = Aretha + SalesTax(Aretha);
    X = X + LateFee(X1,X) + XXX;
    X = X + Interest(X1,X);

    or

    balance = balance - lastPayment;
    monthlyTotal = newPurchases + SalesTax(newPurchases);
    balance = balance + LateFee(customerId, balance) + monthlyTotal;
    balance = balance + Interest(customerId, balance);


    (Hey,was I just trolled?)

  27. Re:SWT by harmonica · · Score: 2, Interesting

    I did, and there are other add-ons too (I remember some Sourceforge project). But I don't like that it isn't part of the core SWT library. Why didn't they support MVC from the beginning? I guess SWT is supposed to be relatively low-level. But that's not what everybody should use, in my opinion, to get back to the original argument.

  28. They might be doing more harm than good by vegetasaiyajin · · Score: 2, Interesting
    I like most of the features, except the "enhanced" for loop and the autoboxing.

    The "enhanced" loop removes readability from the language, but just that.

    Autoboxing is more problematic. For example, if you declare
    ArrayList<int> intList;

    you might be thinking the intList is backed by an array of ints (int[]), but they are not. They are backed by an Object[] and every element is an Integer.
    AFAIK, There is no way to create an ArrayList backed by an int[], so you have to create an alternative class or use int[] directly, but naive programmers are surely going to believe that an ArrayList will be as efficient as an int[] when it will clearly not be.
    --

    My heart is pure, but make no mistake, it's pure evil