Slashdot Mirror


Java 1.4.2 Released

peterwilm writes "Sun released Java 1.4.2 today. It includes many enhancements and changes among them the native look&feel for Win XP and GTK 2.0 as well as support for Itanium 2."

74 comments

  1. How fast is java? by Rares+Marian · · Score: 1, Flamebait

    well how fast is it?

    --
    The message on the other side of this sig is false.
    1. Re:How fast is java? by BrokenHalo · · Score: 3, Interesting

      I personally don't care how fast it is, if it cooperates smoothly with GTK2 then it's good enough for me.

    2. Re:How fast is java? by larry+bagina · · Score: 1, Interesting

      warning -- it looks like gtk2, not gnome, gtk2. That means no theme support, so java apps will run like unthemed gtk2 apps. Personally, gtk looks like a combination of ass and motif. I wouldn't call it much of an improvement

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:How fast is java? by LoneRanger · · Score: 5, Informative

      Read the Swing release notes dude. They support GTK theming as long as it uses a certain GTK engine. They are attempting to support all GTK engines, but evidently it's not easy.

    4. Re:How fast is java? by j3110 · · Score: 4, Insightful

      You know, I'm usually the first man upset when people say "Java is slow" without evidence, but I think performance improvement is a valid question of any new product. It's even more of a question when the new release actually is about performance to a degree. So... I wonder who modded you flaimbait, and why.

      On topic though, I've noticed a lot of performance enhancements. If you don't load a GUI, you're program will start pretty much instantly, and will only take about 5M of RAM for a small program. GUI's will take 6M more just because. I'm sure a lot of the 6M is external to the VM and/or frame buffers.

      In any case, I'm happy that my programs keep getting faster without me having to touch them. Also, now they work on the Itanium2, I can put that in the marketing material. (All with no coding/work on my part.) Sometimes, you have to really appreciate the good sides of Java.

      --
      Karma Clown
    5. Re:How fast is java? by BenTels0 · · Score: 2, Informative
      warning -- it looks like gtk2, not gnome, gtk2.

      Err -- it's not supposed to look like Gnome. GTK = GIMP Tool Kit, not Gnome Tool Kit.

    6. Re:How fast is java? by zmotula · · Score: 2, Interesting

      I just tried it on my GUI app, it's as ugly as anything you can make up :(

      http://www.fi.muni.cz/~xznamen/java-gtk.png

    7. Re:How fast is java? by Anonymous Coward · · Score: 0

      To prove "Java is slow":

      1. Get a Pentium machine with 32M Ram:
      2. Write a simple helloworld with Java, excute it and count how long since the program was started until it was ended.
      3. Write a simple helloworld with C/C++/Perl/Python/C#(.NET?)/etc..., excute it and count how long since the program was started until it was ended.

      You must know the result.

      Anyway, I don't think performance is the only thing we count for when choosing development platform and language. Why can't simply accept the fact that Java is slow? It is not a fault to me that I don't choose ASM in case it is faster than anything. Maybe I would like to use C++ just because I can code faster, or Java for cross-platform binaries, etc...

      I'm usually the first man upset when people say "Java is not slow". I understand maybe it is not slow in your machine (Itanium 2, right), doesn't mean it is fast on every existing machines in this world.

    8. Re:How fast is java? by j3110 · · Score: 1

      I think you have a skewed definition of slow. Maybe I should say:

      1. Get a Pentium maching with 32M Ram.
      2. Run hello world in Java.
      3. Reboot into Linux and run HelloWorld.

      It took longer to reboot, so Linux and C is Slower than Java?

      I think what you mean is that Java takes too long to start, and I, and everyone in the whole community, agrees with you. However, if you say that a Java program is unusable for user interaction on a pentium, you're just trolling.

      You're point is the focus of this release of Java, I would say. 30% cut back in start times. On 400Mhz machines, Java still starts command line programs pretty much instantly now. At least it is fast enough to interact with despite that you are loading a VM every time you run a program.

      The Java community is actually outraged that SUN keeps pushing the shared VM technology further back. Imagine if your hello world program only needed to be loaded and interpretted. I think the overhead of creating a new process may exceed the overhead of Java. At that point, I think your arguement would be pointless. This is what we, the developers, are working for. I just hope you or others like you aren't so short sighted that you can't see that Java performance is that close at hand.

      Java is really made for people that want to make large projects. If you have some 2-bit project that wouldn't benefit from all the safety checking, you should use C probably, but then again, would performance be an issue for a small task?

      I thought the whole point of Java was that it made life easier on programmers, so how can you say that you can program faster in C++ unless you are ignoring memory management? What about using non-STL libraries? Will other developers still understand your code if you use wxWindows instead of GTK? Java makes programming easier both the first time, and when you have to come back and add functionality.

      You may compare Perl to Java, but then you would loose the performance arguement, but win the easy to program arguement, but loose the easy to maintain arguement, and win the quick start arguement. Java's regular expression engine is significantly faster than Perls (as in levels of magnitude, not petty 10%'s).

      Java is a good all around best choice for most programing tasks, unless you can understand LISP. It excels in daemon work, but never really gets used there. Consider that you will never have buffer overflows, you will usually not have to restart daemons, and Java has a framework for single threaded TCP/IP IO. You could also reduce memory footprint by having one VM load several TCP/IP server "modules".

      --
      Karma Clown
    9. Re:How fast is java? by Anonymous Coward · · Score: 0

      Nope. Take a decent machine.

      By "decent" I mean Pentium 4 2 GHz, 1 GB RAM, 120 MB HDD 7200 rpm.

      Write something complex, in Java and in another language like C++ or Delphi.

      Run them and time them.

      I did this test myself.. and guess what.. Java was A LOT slower then Delphi.

      Ok, maybe for some apps it doesn't matter, but the fact that Java is slow .. is a FACT, not an opinion.

      You can easily prove it to yourself just by doing the test above.

    10. Re:How fast is java? by archeopterix · · Score: 1
      I think what you mean is that Java takes too long to start, and I, and everyone in the whole community, agrees with you. However, if you say that a Java program is unusable for user interaction on a pentium, you're just trolling.
      Hello from Pentium 166 MMX/32 Megs of RAM. Java is slow here even for user interaction. I run CGoban (Go Client and SGF editor). It's slow and I'm not talking about startup time. I have an older version by the same author written in C. It's fast.

      Fade in to Pentium III 700 MHz 512M of RAM. IBM Websphere Application Developer (based on Eclipse). Slow.

      Ok, it doesn't prove that Java is slow. Perhaps the developers did thing the wrong way. Perhaps my perception of "slow" is skewed. However, in my experience Java apps are slow and I sincerely wish that someone could prove me wrong.

    11. Re:How fast is java? by dkf · · Score: 1
      Java is a good all around best choice for most programing tasks, unless you can understand LISP. It excels in daemon work, but never really gets used there. Consider that you will never have buffer overflows, you will usually not have to restart daemons, and Java has a framework for single threaded TCP/IP IO.

      I'd agree that it is on the server-side that Java's strengths really start to show. The lack of buffer-overruns is rather good, the built-in support for security is rather good, the speed is rather good too. The I/O... well, at least doesn't suck as much as it used to though it is nowhere near as usable as it ought to be...

      I won't defend the speed (or, for that matter, the usability) of Java2D/Swing though. Client code is not Java's strength IMHO.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    12. Re:How fast is java? by j3110 · · Score: 1

      Actually... I was running Eclipse on a Pentium 166 with 32M of RAM once. It was horribly slow because it spent most of the time swapping memory to disk. When the hard drive light wasn't constantly on, it was usable, but that situation rarely happens when X takes up all the memory already.

      You can't compare versions of software that way anyhow. Software usually gets slower every revision just because. If it wasn't that way, then Windows XP would run really fast on a Pentium 166 since it is 5 generations of software more than Win95.

      I don't know what you are doing to make Eclipse slow on your machine with 512M of RAM. Maybe the Webshere version just has so many plugins that you actually should set the heap size up. Are you running the latest JRE (IBM doesn't have a 1.4 for Windows the last time I checked)? I would definately say there is something wrong though if Eclipse is slow on your machine. Check how much memory it is using. If it's close to 64m, then it has filled the default maximum heap size.

      Try this:
      java -Xmx256M -cp startup.jar org.eclipse.core.launcher.Main

      You may want to play with the 256M number since you have a lot of RAM. I hope SUN comes up with a way to automatically optimize the maximum heap size dynamically.

      --
      Karma Clown
    13. Re:How fast is java? by PoewrpuffElote · · Score: 1

      Bravo!

      Java is slow... absolutely... the good thing is how portable this language is...

      Nowadays systems require fast responses, I think for this purpose Java is not the best option.

      Swing is great... easy and nice.

      I guess programmers just need to make a decision on what their needs are... and what languages provide.

      Damn! its all about decisions, isn't it?

    14. Re:How fast is java? by archeopterix · · Score: 1

      I don't think that this is a problem with RAM. I've checked the usage graphs and the only resource that is at 100% most of the time is the CPU (and sometimes disks). The java process uses around 300 megs on the average, so I think that the heap size is already adjusted.

    15. Re:How fast is java? by j3110 · · Score: 3, Insightful

      Because java forks processes, sometimes the OS will lie about how much memory Java is actually using. Turn on the Thread count option so you can see how many threads the process has. I can run Eclipse with -Xmx4M but not 2M. When I run it with 4M, I get 30M usage in 11 threads.. 11*4=44M which would be the maximum windows could report.

      If you have 11 threads, and you are using 300M, you are getting around 90% usage of a 32M heap. This means the VM has to relocate memory in order to bring up new windows, and text files you have open will be fragmented and/or garbage collected when you switch away.

      Really, you should try -Xmx256M, and I bet it runs much smoother.

      The default settings only lets java claim 64M of RAM last time I checked.

      Isn't it funny that everyone complains about Java's memory footprint when in fact the memory usage is usually about 10% of what they think it is because Java spawns at least 4 threads, and usually 5-6. Console applications use about 5 threads and consume about 1M of RAM, but they get reported as 5M or so RAM.

      By default, the OS will report each individual thread as having access to the heap, so each thread is claiming about 3M of RAM in eclipse on my computer. So, windows adds them all together (11 threads) and tells me there is 30M of RAM in use. (It will actually start with only 3M of heap on my computer, but it's slow.)

      People on Linux systems add together all the VM memory usage and say Java is using 1G of RAM on my linux machine (because Java on Linux uses more RAM for some reason.) The real way to calculate the ammount of RAM in use is to take the RSS field of "ps" of the largest process (they should all be the same, but sometimes they have some handles that are just allocated to a single thread where the heap is accessable to all.).

      --
      Karma Clown
    16. Re:How fast is java? by znaps · · Score: 1

      The problem isn't Eclipse, it's Websphere. WSAD is an absolute pig and the worst memory hog I've had the displeasure of having to work with. You need 1 GB to get it to run smoothly all day.

      To be fair though, it does have a full J2EE Server/Test environment built in, and it is very useful when you get a chance to work with it between the 2 minute page swaps....

    17. Re:How fast is java? by jechoe · · Score: 1

      rofl .. would that be asstif or mo-ass?

      --
      Push the envelope. Watch it bend.
  2. startup time improvements by brlewis · · Score: 4, Informative
    From my POV, this looks like the most significant change:
    Optimizations have been made to the core libraries to reduce startup time. For a small command line application, startup time has been reduced by roughly thirty percent; for a small Swing application, by fifteen to twenty percent.
    1. Re:startup time improvements by melete · · Score: 5, Informative


      Yeah, that's a HUGE improvement. But playing with the beta, the biggest speed enhancement seems to be in the networking code -- it's a lot cleaner, faster, and not nearly as buggy as 1.4.1

    2. Re:startup time improvements by Randolpho · · Score: 1

      It still doesn't appear to be as fast as most scripting language interpreters. But a very good thing to improve on.

      Perhaps a memory resident component would be a better way to go, although I hate anything that saps CPU cycles. :)

      --
      "Times have not become more violent. They have just become more televised."
      -Marilyn Manson
    3. Re:startup time improvements by BenTels0 · · Score: 2, Informative

      I just ran through some of the demoes -- I like! Much faster on loading.

    4. Re:startup time improvements by Anonymous Coward · · Score: 0

      Wow!!
      On my Apple II+ this means my programs start up in two days as opposed to three!

    5. Re:startup time improvements by cakoose · · Score: 3, Interesting

      That's because a large part of some scripting language libraries is native code and is kept as a shared library (to be faulted in as necessary).

      Java's libraries are mostly written in Java and they are loaded, verified and usually partly compiled each time. Since is not part of the "text" segment (it's probably in the heap), sharing requires using some shared memory facilities.

      I think it would be nice if there was a "javalib" utility that would load up the Java classes, compile them, and produce a DLL. Then at least the JVM wouldn't have to load (and/or recompile) the core library every time.

      To take it even further, if the JVM was suid root, the DLL could be updated every time anybody runs a Java program (like suid "man").

    6. Re:startup time improvements by eggnet · · Score: 1

      For what it's worth, I believe Java on OSX is always loaded.

  3. from the "ya don't say" department by scrytch · · Score: 4, Funny
    I found this "issue" a little mysterious:

    The Java HotSpot VM cannot expand its heap size if memory is completely allocated and no swap space is available.

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  4. Well by ENOENT · · Score: 4, Funny

    I expect my Java VM to start killing off other processes at random until it DOES work!!!

    --
    That's "Mr. Soulless Automaton" to you, Bub.
    1. Re:Well by sean23007 · · Score: 2, Funny

      I expect my Java VM to order more RAM online and install it for me.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
  5. Yesterday by BoomerSooner · · Score: 2, Interesting

    I downloaded it yesterday so I must have been lucky. I needed it for eclipse. BTW where the hell is good free online documentation on how the hell to use eclipse, swt, etc.?

    1. Re:Yesterday by Adhoc · · Score: 4, Informative

      There is a lot of documentation built into eclipse. Look under Help -> Help Contents. There are developer guides and API references for most of elcipse/swt. Also, check Eclipse Articles on the eclipse website for some more tutorials and guides.

    2. Re:Yesterday by kashmirzoso · · Score: 3, Informative

      http://dev.eclipse.org/help21/index.jsp

  6. Is anyone else having problems to connect? by antdude · · Score: 1

    I keep getting connection refused. How about you?

    --
    Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
    1. Re:Is anyone else having problems to connect? by jmertic · · Score: 4, Informative

      Same here. After it gets your personal info, it trys to redirect to a server that isn't there. In IE, it leaves that URL in the address bar. Remove the port info and you can keep going.

    2. Re:Is anyone else having problems to connect? by antdude · · Score: 1

      Thanks jmetric. That trick worked. :)

      --
      Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
    3. Re:Is anyone else having problems to connect? by Anonymous Coward · · Score: 2, Informative
      You gave it your personal info???

      You do know there was a link to skip that and go straight to download, don't you?

  7. XP Look 'n Feel? by digerata · · Score: 4, Insightful
    Alright, I am a avid proponent of java. But come on guys, XP has been out for almost two year and they are just *now* releasing support for that look and feel?

    That's just one more reason why people are flocking to SWT over Swing.

    --

    1;
    1. Re:XP Look 'n Feel? by Anonymous Coward · · Score: 0

      Not supporting the XP look and feel is a FEATURE.

      Even Microsoft has dropped the playschool interface in Windows 2003

    2. Re:XP Look 'n Feel? by Anonymous Coward · · Score: 0

      Isn't the Luna theme disabled by default but still present in W2K3?

    3. Re:XP Look 'n Feel? by jbuilder · · Score: 1

      You've GOT to be kidding. Look, if you think an LAF is reason enough to use one widget library over another, perhaps you should consider another language more to the taste of Windows programmers... Perhaps VB.NET?

      --
      Polymorphism -- It's what you make of it.
    4. Re:XP Look 'n Feel? by be-fan · · Score: 1

      Nope, I have to throw in a plug for SWT here too. The Java LAF's in Linux suck badly. Crappy font rendering, no anti-aliasing, totally non-native looking, etc. Eclipse, OTOH, looks completely native, and follows my GTK2 theme :)

      --
      A deep unwavering belief is a sure sign you're missing something...
    5. Re:XP Look 'n Feel? by Wesley+Felter · · Score: 1

      Windows Server 2003 is a server OS; that's why it doesn't have as much eye candy.

    6. Re:XP Look 'n Feel? by Cnik70 · · Score: 1

      WindowsLookAndFeel has been available for a long time, not too much different than XP LookAndFeel

      --
      -Cnik
  8. What version is that? by PD · · Score: 3, Funny

    Would that be Java 1.4.2, or is it Java 2. Or is it Java 2 full speed? And when will SCO be suing the bastards?

    1. Re:What version is that? by calennert · · Score: 4, Informative

      J2SE, v.1.4.2 = Java 2 Platform, Standard Edition, version 1.4.2

    2. Re:What version is that? by Randolpho · · Score: 1

      Java >=1.2 == Java 2. Just FYI. :)

      "And when will SCO be suing the bastards?"

      Heh... Just as soon as they can con a lawyer into believing they have the patent/copyright/etc.

      --
      "Times have not become more violent. They have just become more televised."
      -Marilyn Manson
    3. Re:What version is that? by Kragg · · Score: 2, Funny

      Java >= 1.2 == Java 2

      and so transitivity gives us Java >= Java 2. I always suspected, thanks for the proof.

      --
      If you can't see this, click here to enable sigs.
  9. WOW by Photar · · Score: 1

    That seems like alot of improvements for such a smal point update.

    --
    He who knows not and knows he knows not is a wise man. He who knows not and knows not he knows not is a fool.
    1. Re:WOW by Golthar · · Score: 3, Interesting

      Yes a lot of these things were held off.
      Sun seems to be heading more toward the desktop these days, with improved start up time and less memory consumption.

      However, they tend not to make any large functionality changes between point releases

    2. Re:WOW by Photar · · Score: 1

      On that note, I think java is a really neat technology. I'd like to see more of it. I just hope MS doesn't kill them with that .NET crap.

      --
      He who knows not and knows he knows not is a wise man. He who knows not and knows not he knows not is a fool.
    3. Re:WOW by Golthar · · Score: 2, Interesting

      I don't think they will.
      I for one have to still see stable version of .NET running on things like the mac, Sun hardware, HP UX, IBM Mainframes.

      Time will tell though, but I have a good feeling about Java, especialy since the last few releases

  10. test windows java update feature and win a t-shirt by jwegis · · Score: 1
  11. Mother fuckers by ShatteredDream · · Score: 1, Funny

    I literally just finished downloading the 2nd beta last night.

    1. Re:Mother fuckers by Anonymous Coward · · Score: 0

      You sure that wasn't J2 E E (as opposed to J2 S E) ?

  12. Re:Java 2.0... by Anonymous Coward · · Score: 0

    mod parent up!! The marketing folks at Sun had already fscked up solaris/sunos version numbers, and now Java.

  13. Garbage Collection and Java NIO by Anonymous Coward · · Score: 3, Insightful

    Garbage Collection is the enemy of NIO. You have to explicitly close everything now. And tell me why optional deterministic destruction in Java is considered a bad thing? Writing all this extra code to close stuff sucks.

    New I/O (NIO)

    The following changes have been made to java.nio functionality in J2SE 1.4.2.

    * The finalize methods of the primitive channel classes (SocketChannel, ServerSocketChannel, etc.) have been removed (4777499). Performance testing revealed that the presence of these methods imposed a significant (factor of 100) garbage-collection penalty upon server-type applications that process thousands of new open channels per second. User code that deals in channels should be carefully written to close channels explicitly rather than rely upon the garbage collector to do so.

    1. Re:Garbage Collection and Java NIO by Anonymous Coward · · Score: 2, Informative

      This helps explain some of the issues:
      http://developer.java.sun.com/developer/b ugParade/ bugs/4525842.html

    2. Re:Garbage Collection and Java NIO by aaronlauinger · · Score: 1

      yes being able to explicitly destroy on object would be nice.

      but in the mean time do you really want to use finalizers to close your sockets anyways? It might be a crutch but its basically equivalent to not closing them at all.

    3. Re:Garbage Collection and Java NIO by dkf · · Score: 1

      Sure, but since you've no real idea when GC's going to happen, you'd better close things anyway because otherwise you'll hit your per-process limit on the number of FD's. (You do have process accounting turned on, yes?) It's always been good style to use close() with I/O in Java, and the NIO mods just push this a tiny bit further. (Thank goodness for try{...}finally{...}!)

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    4. Re:Garbage Collection and Java NIO by Anonymous Coward · · Score: 0

      you stupid dumb fuck piece of shit posting a link to a 404. fuck you asshole. suck my fucking dick, biatch.

  14. Re:8 minutes and 42 seconds to download! by Anonymous Coward · · Score: 0

    How fast is my cable modem?

    Faster than Java. :-P

  15. Re:Still building 1.4.1 native on FreeBSD! by cakoose · · Score: 2, Insightful

    If your machine is swapping non-stop, it could be thrashing. If it's thrashing, then you should probably give up and buy more memory since you're basically using your hard drive as RAM at this point.

    You might want to try generating the Java API docs with 'javadoc' for more VM fun.

  16. Puzzling Download Size by Tetch · · Score: 3, Interesting
    Hmm. For a point release, the increase in (Windoze) download size - double - is quite astonishing.

    On my PC :

    j2re-1.4.0_01-windows-i586.exe - 9170 Kb
    j2re-1.4.1_01-windows-i586.exe - 7829 Kb
    j2re-1.4.2-windows-i586.exe - 14162 Kb

    Does anyone understand this ?
    In fact, does anyone know why the download size actually went down betwen 1.4.0 and 1.4.1 ? Not that I'm complaining about that :-) ... I just assumed the code got more efficient ... but by the same token, it just got a whole lot less efficient ... or bloated, or something. Maybe it's all those multiple environment look'n'feels.

    --
    If you don't pray in my school, I won't think in your church.
    1. Re:Puzzling Download Size by Anonymous Coward · · Score: 4, Informative

      1.4.0 and 1.4.1 had their JREs split up into US English only and International versions. The sizes you give for the older versions are the US English only and thus smaller version.

      With 1.4.2 they seem to only offer the international version now, hence the increase.

  17. Re:Still building 1.4.1 native on FreeBSD! by Anonymous Coward · · Score: 0

    That doesn't have to be true.

    Say you have a machine with 256MB RAM. You run a Java app with -Xmx256M. Java will allocate up to 256MB of RAM since it doesn't know that only the first 200M is fast and the remaining 56MB is swap.

    Decrease -Xmx to 150M and the gc() will run more often, not swap, and run more efficiently.

  18. Deadlock Detection finally works?! by NumbThumb · · Score: 1

    I think the most interresting change ist this:

    These previously unimplemented JVMDI functions have been implemented:

    jvmdiError GetOwnedMonitorInfo(jthread thread, JVMDI_owned_monitor_info *infoPtr)

    jvmdiError GetCurrentContendedMonitor(jthread thread, jobject *monitorPtr)

    Does this mean monitor information is now reported correctly in profiler-dumps and via JPDA? That would be soooo great -- i'm waitng for that for 2 years now. Finding deadlocks using a trial-and-error aproach ist just a pain... Eclipse even has an extra "Threads/Monitors/Deadlocks" view, that just keeps telling me that my VM does not support that feature:(

    Does anyone know more?

    BTW: don't use the web-installer (window), it's slow. go for the offline version. And you don't need to fill the info form. There is a "continue download" link at the top.

    --
    I have discovered a truly remarkable sig which this 120 chars is too small to contain.