Beta

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

IcedTea's OpenJDK Passes Java Test Compatibility Kit

timothy posted more than 6 years ago | from the oh-joyous-day dept.

Java 271

emyar writes "At JavaOne in May, 2006, Sun Microsystems announced they were going to release Java as free software under the terms of the GPL. The size of the task (6.5 million lines of code) was only eclipsed by the size of the opportunity for Java as a free and open technology. [...] This week the IcedTea Project reached an important milestone — The latest OpenJDK binary included in Fedora 9 (x86 and x86_64) passes the rigorous Java Test Compatibility Kit (TCK). This means that it provides all the required Java APIs and behaves like any other Java SE 6 implementation — in keeping with the portability goal of the Java platform."

cancel ×

271 comments

Sorry! There are no comments related to the filter you selected.

pirst foast (-1, Offtopic)

Anonymous Coward | more than 6 years ago | (#23861267)

fail LOL LOL LAWL

Just use a glove (0, Troll)

malfist (1152363) | more than 6 years ago | (#23861305)

So why don't they just use Java's JKD?

Re:Just use a glove (5, Informative)

sidnelson13 (1309391) | more than 6 years ago | (#23861665)

OpenJDK came to surface due to pressure of the OS community, to be to fulfill OS purists' ideals. For example, being able to embed the JDK into OS Linux systems.

OpenJDK is an effort backed up by Sun also, so that is no impasse here.

This is great news! I can see faster and greater improvements coming to the JDK having it open.

Re:Just use a glove (2, Informative)

VGPowerlord (621254) | more than 6 years ago | (#23862371)

I was under the impression that OpenJDK [java.net] was the Sun JDK7 project.

Wow. (-1, Offtopic)

Anonymous Coward | more than 6 years ago | (#23861347)

Maybe Java won't suck so hard now.
(I'm allowed to say that, I'm black.)

Perfomance (2, Insightful)

electricbern (1222632) | more than 6 years ago | (#23861365)

How about performance. It is a great milestone, it is, but if it is too slow it isn't ready for prime time.

Re:Perfomance (5, Informative)

JimDaGeek (983925) | more than 6 years ago | (#23861467)

They are using the "real" Java source. Only 4% of the Sun Java code wasn't released. So IcedTea only had to implement the 4% of Java that wasn't GPLed.

Re:Perfomance (5, Funny)

Reverend528 (585549) | more than 6 years ago | (#23862589)

IcedTea only had to implement the 4% of Java that wasn't GPLed.

Although 4% doesn't sound like much, it's actually just short of 8 billion lines. It sounds unbelievable that they could accomplish that so quickly, but Java's strength is in making it easy to write large amounts of code.

Re:Perfomance (1)

Z34107 (925136) | more than 6 years ago | (#23863573)

Others would have modded you funny (instead of flamebait), too, but they were destroyed by Java's implementation of "sockets."

Think "light bulbs" instead of "network connectivity" and you'll see what I mean.

Re:Perfomance (1, Interesting)

sm62704 (957197) | more than 6 years ago | (#23861817)

How about performance. It is a great milestone, it is, but if it is too slow it isn't ready for prime time.

With 6.3 megs of source my guess is the guy from Space Oddessy would say "My God! It's full of bloat!"

I would be incredibly surprised if it was speedy. I wonder how many of those lines are "NOP"? How many of them are comments? How many are actual, once working code that has been commented out?

Re:Perfomance (2, Insightful)

glebfrank (58922) | more than 6 years ago | (#23863241)

You do realize that NOPs and comments do not affect the speed of the software, once it's compiled?

Re:Perfomance (1)

JebusIsLord (566856) | more than 6 years ago | (#23863297)

Since most of the java source is in java, I doubt there are many (if any) "NOP"s in there... also, you're aware comments don't get compiled, right? So like, they won't slow it down? Yeesh. Anyhow, as mentioned above, this is based on the official Sun code so the performance should be pretty damn close.

Really ? (-1, Flamebait)

jalet (36114) | more than 6 years ago | (#23861371)

> and behaves like any other Java SE 6 implementation

Does this mean it consumes 2 GB of RAM to display "Hello World" ???

Re:Really ? (1, Funny)

tritter (1294692) | more than 6 years ago | (#23861477)

You mean Vista is written in Java?

Re:Really ? (0)

Anonymous Coward | more than 6 years ago | (#23861563)

Feels like it.

Re:Really ? (4, Funny)

PinkPanther (42194) | more than 6 years ago | (#23861549)

Does this mean it consumes 2 GB of RAM to display "Hello World"???

Man! Was that joke ever funning circa 1997...

Re:Really ? (4, Funny)

ais523 (1172701) | more than 6 years ago | (#23861595)

Does this mean it consumes 2 GB of RAM to display "Hello World"???

Man! Was that joke ever funning circa 1997...

Yes, nowadays everyone has the 2GB of RAM, due to Windows Vista, so it isn't a problem.

Re:Really ? (1)

jalet (36114) | more than 6 years ago | (#23861635)

Circa 1997 nobody could afford having 2 GB of RAM.

Re:Really ? (3, Funny)

snoyberg (787126) | more than 6 years ago | (#23861889)

I had 2 GB of RAM you insensitive clod.

Re:Really ? (2, Informative)

afidel (530433) | more than 6 years ago | (#23862703)

Sure they could the Cray T90 came out in 1995 with up to 8GB of ram and the Y-MP M90 came out in 1992 and had up to 32GB of ram, the T3D came out in 1993 with up to 64GB of ram. Basically your run of the mill supercomputer had several times that much ram by the mid 90's =)

Re:Really ? (1)

jalet (36114) | more than 6 years ago | (#23862841)

Sorry I was thinking about individuals or small companies.

Re:Really ? (3, Insightful)

sm62704 (957197) | more than 6 years ago | (#23861927)

Does this mean it consumes 2 GB of RAM to display "Hello World"???
Man! Was that joke ever funn[y] circa 1997...
And in 1987 it was "Does this mean it consumes 2 MB of RAM to display 'Hello World'???" and in in 2017 the joke will be upgraded to "Does this mean it consumes 2 TB of RAM to display 'Hello World'???"

Why does it seem that every time the hardware guys give us more machine, the software guys use every last bit of it to do exactly what the previous generation of machines did, only the previous generation did faster?

Re:Really ? (5, Insightful)

bsDaemon (87307) | more than 6 years ago | (#23862021)

Because each generation of "software guy" becomes n+1 generations removed from being a hardware guy himself. That is to say, the tools become "better" to make programming "easier" for people who aren't also electrical engineers.

At least, if I had to guess, that's what I'd say.

Re:Really ? (1)

peragrin (659227) | more than 6 years ago | (#23862247)

Well that explains a lot. It explains why with every iteration OS X streamlines a bit making it slightly faster on the same hardware, It explains why OS X can do everything Vista does on a quarter of the hardware.
it is because Apple controls the hardware thus promoting a tighter bonds between the two groups of people.

Re:Really ? (2, Interesting)

Anonymous Coward | more than 6 years ago | (#23862625)

You don't realize (or maybe you do) how accurate this is. As much as I hate to admit it, I'm a perfect example.

I sit right next to a guy at work that went to the same university I did. However he's got 10 years on me. Both degrees are in Computer Science. Yet he knows a LOT more about E.E. stuff than I do. It seems the curriculum at our school got softer (pun intended) as the years went on.

I realize this at least and do my best to pick up bits and pieces from him and the other E.E. guys here at work. But it does disappoint me a bit that I didn't get the same level of education as my co-worker.

Re:Really ? (5, Funny)

Anonymous Coward | more than 6 years ago | (#23862273)

You forgot the corrolary to Moore's Law, Which is Gates's Law: Every 18 months, the speed of software halves.

Mono needs a similar testsuite. (5, Insightful)

Anonymous Coward | more than 6 years ago | (#23861381)

If Mono wants to ever become suitable for enterprise use, it will need a testsuite and compatibility kit like this. One of the main benefits of Java is the stringent standards that implementations must adhere to. This brings a level of predictability that we just can't get from .NET or Mono. And for huge enterprise apps, that predictability is totally necessary.

Re:Mono needs a similar testsuite. (2, Insightful)

Funks (661017) | more than 6 years ago | (#23861957)

If Mono wants to ever become suitable for enterprise use, it will need a testsuite and compatibility kit like this. One of the main benefits of Java is the stringent standards that implementations must adhere to. This brings a level of predictability that we just can't get from .NET or Mono. And for huge enterprise apps, that predictability is totally necessary.
And you believe that it would be in Microsoft's best interest to create a .NET platform TCK?

Re:Mono needs a similar testsuite. (0)

Anonymous Coward | more than 6 years ago | (#23862077)

Yeah, Mono is an necessary evil for Microsoft.

When the time comes, Mono won't be a .NET clone anymore. It will be a clone of the old .NET, totally incompatible with the new .NET.

Although, considering Mono is a good two major revisions behind the reference implementation at this point, it may happen sooner than Microsoft anticipates. That may slightly limit Microsoft's tactical advantage when it comes to crushing open source.

Re:Mono needs a similar testsuite. (1)

Saint Stephen (19450) | more than 6 years ago | (#23862023)

On Windows machines, .NET is hugely predictable :-) Microsoft is "not bad" for actually getting stuff done. In the last few years, I've done SQL server, Oracle, and lastly DB/2 running on an AS/400, all from C# using pretty much the same techniques. It gets the job done, enterprise-wise.

Re:Mono needs a similar testsuite. (1)

oldhack (1037484) | more than 6 years ago | (#23862361)

I think .NET's main adv. over Java is its interop with Windows native services (Win32, COM, etc.) that derives from tight coupling with Windows, and MS isn't trying much to hide this. The Mono project must amuse the MS .NET team a good deal.

Re:Mono needs a similar testsuite. (0)

Anonymous Coward | more than 6 years ago | (#23862643)

On Windows machines, .NET is hugely predictable :-)
... until the new, improved version comes out with completely incompatible core features a la RDO, ADO, DAO, DOA or their SOAP interfaces, etc. etc. etc.

Been there, done that, bled heavily. Swore it off.

Maybe you don't understand .Net? (4, Informative)

encoderer (1060616) | more than 6 years ago | (#23863541)

For the last 2 years I've been doing Python work with a little PHP but the 2 before that were spent almost exclusively in .Net (C# and IronPython).

Right now on my dev box I have 4 versions of .Net.

They run side-by-side without issue.

There is no forced upgrade. It's like saying that C wasn't predictable because C++ emerged.

Re:Mono needs a similar testsuite. (3, Funny)

DickBreath (207180) | more than 6 years ago | (#23862157)

Mono already has a much simpler compatibility test.
  • Does it run on Windows? (Check)
  • Does it have poisonous patents? (Check)
Okay, it passes.

Re:Mono needs a similar testsuite. (0)

Anonymous Coward | more than 6 years ago | (#23862513)

Is it total fucking shite? (Checkeroonie)

Re:Mono needs a similar testsuite. (1)

neuromancer23 (1122449) | more than 6 years ago | (#23862441)

Hmmm... I don't think Mono or anything else will ever be a competitor of Java. Even if you discount Java's superior performance, security, stability, superior APIs that are decades ahead of anything at microsoft, and vast amounts of open-source libraries, the Mono project if it wants to maintain compatibility with .NET will always be held mercy to the whims of Microsoft.

The real benefit of Mono: .NET is going to Microsoft. Once all Windows applications are written in .NET, why would anyone want to use Windows?

Factoid:

Did you know? The term "Microsoft" was originally Bill Gates' pet name for his penis.

bfd (1, Insightful)

speedtux (1307149) | more than 6 years ago | (#23861427)

So, Sun's own codebase passes their own compatibility suite. BFD.

If after more than a decade, there is not a single, independent, compliant Java implementation, then there is evidently something wrong with the Java platform.

Re:bfd (4, Interesting)

PinkPanther (42194) | more than 6 years ago | (#23861535)

How does having an "independent" (whatever that means) implementation make a platform "right" (or rather, lack of one make it "wrong").

What is it that is "wrong" in the platform? The fact that the base implementation is solid enough that few others found need to rewrite that wheel?

Re:bfd (4, Insightful)

Jah-Wren Ryel (80510) | more than 6 years ago | (#23862133)

What is it that is "wrong" in the platform? The fact that the base implementation is solid enough that few others found need to rewrite that wheel?
Because you get people coding to the bugs of the implementation without even realizing it, since it works after all. And then eventually you reach a point where new versions don't fix the bugs because too many systems depend on them. Sound like a monopolist you know?

Re:bfd (0)

speedtux (1307149) | more than 6 years ago | (#23862205)

Sun claims that Java is an open "standard".

If, after a decade, nobody has managed to produce an independent, compliant, commercial implementation, then that suggests that doing so is too hard. Maybe Sun's specifications are incomplete, maybe the specs are so complex that they are too hard to implement, maybe Sun keeps changing the platform too quickly.

Why does it matter? If Sun were to go belly-up [yahoo.com] tomorrow, there would be no compliant commercial Java implementation left.

Re:bfd (4, Informative)

AKAImBatman (238306) | more than 6 years ago | (#23862351)

Re:bfd (1)

bunratty (545641) | more than 6 years ago | (#23863209)

In addition to a JVM, you need compilers [devlib.org] . If there's any part of Java that is complex or that there are incomplete specifications for, it may be those huge standard libraries. But doesn't Sun ship the source code to those with every JDK?

Re:bfd (0)

Anonymous Coward | more than 6 years ago | (#23862847)

Whoohoo! My sunoco stock is kicking ass!

Re:bfd (5, Informative)

pmontra (738736) | more than 6 years ago | (#23861539)

Actually, Sun's own codebase and a 4-5% of rewritten code passes Sun's compatibility suite.

TFA is about that 4-5% which was encumbered by patents (? the article doesn't go into details) and has been rewritten to make all the JDK free. That should be enough to finally get Debian include Java in their distributions.

Re:bfd (1)

oldhack (1037484) | more than 6 years ago | (#23862059)

Good info. But Debian's included (don't know which branch) SUN's JDK for quite sometime now, since the change in the license of JDK, I think.

Re:bfd (0)

Anonymous Coward | more than 6 years ago | (#23863443)

That should be enough to finally get Debian include Java in their distributions.

bob@debian > apt-cache search sun-java
ia32-sun-java6-bin - Sun Java(TM) Runtime Environment (JRE) 6 (32-bit)
sun-java6-bin - Sun Java(TM) Runtime Environment (JRE) 6 (architecture dependent files)
sun-java6-demo - Sun Java(TM) Development Kit (JDK) 6 demos and examples
sun-java6-doc - Sun JDK(TM) Documention -- integration installer
sun-java6-fonts - Lucida TrueType fonts (from the Sun JRE)
sun-java6-javadb - Java(TM) DB, Sun Microsystems' distribution of Apache Derby
sun-java6-jdk - Sun Java(TM) Development Kit (JDK) 6
sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files)
sun-java6-source - Sun Java(TM) Development Kit (JDK) 6 source files
openoffice.org - OpenOffice.org Office suite
ia32-sun-java5-bin - Sun Java(TM) Runtime Environment (JRE) 5.0 (32-bit)
sun-java5-bin - Sun Java(TM) Runtime Environment (JRE) 5.0 (architecture dependent files)
sun-java5-demo - Sun Java(TM) Development Kit (JDK) 5.0 demos and examples
sun-java5-doc - Sun JDK(TM) Documention -- integration installer
sun-java5-fonts - Lucida TrueType fonts (from the Sun JRE)
sun-java5-jdk - Sun Java(TM) Development Kit (JDK) 5.0
sun-java5-jre - Sun Java(TM) Runtime Environment (JRE) 5.0 (architecture independent files)
sun-java5-source - Sun Java(TM) Development Kit (JDK) 5.0 source files

mod parent up (1)

mpapet (761907) | more than 6 years ago | (#23861599)

Well said sir.

GPL or not, based on Sun's behavior around their Indiana/OpenSolaris (That can't be called OpenSolaris because Sun said no)will pretty much kill whatever advantages going GPL/community driven may bring.

Re:bfd (5, Informative)

Anonymous Coward | more than 6 years ago | (#23861629)

So, Sun's own codebase passes their own compatibility suite. BFD.

If after more than a decade, there is not a single, independent, compliant Java implementation, then there is evidently something wrong with the Java platform.
What in the world are you talking about?

There has been multiple compliant java-implementations for years now.

IBM's JDK (which is their own codebase).
and ORACLE's JDK (BEA JRockit)

both of which passed the Java TCK and can claim Java compatibility and compliance.

As for performance, the OPENJDK is based primarily on SUN's JVM code, hence it has the exact same optimizations (same HOTSPOT, and etc). Only a small majority of the code was replaced with open source alternatives which doesn't affect performance.

Re:bfd (1)

jfbilodeau (931293) | more than 6 years ago | (#23863535)

If I'm not mistaken, BEA JRockit is a licensed derivative of Sun's source optimized for WebLogic.

Re:bfd (4, Insightful)

DickBreath (207180) | more than 6 years ago | (#23862249)

Question: How long did it take Wine to come up with something mostly compatible with Windows? Fifteen years?

Have you considered that Java is almost like writing an OS? A runtime byte code, compiled form multiple source languages. Almost every service of an OS provided in a portable way. (eg, sound, video, graphics, multiple portable widget toolkits, network access, file access, system tray access, and the list goes on...)

GNU Classpath is mostly compatible now. Much like Wine.

Re:bfd (1)

loftwyr (36717) | more than 6 years ago | (#23862373)

If Wine had had the Windows Codebase (-4%) to start with, I doubt it would have taken 15 years. They had to do it starting from scratch and with no help from the codebase it was starting with.

OpenJDK started with 96% of Sun's Java codebase.

Language Compatibility vs. Class Libraries (3, Interesting)

KidSock (150684) | more than 6 years ago | (#23861557)

Languange compatibility was never the main problem - it was class libraries. Java has a mountain of class libraries.

Unfortunately most of them are complete bloat (e.g. Swing, NIO, logging ...). Each package is like a treatise on OOP and design patterns. When are people going to learn that OOP is just one tool of many?

But Java the *language* is great. I wish that someone would create a non-bloat version of the Java class libraries. Do an analysis of important use cases, redesigned the class libraries to be much less "fluffy" and then post some metrics to show how much better it performs.

Re:Language Compatibility vs. Class Libraries (5, Funny)

jalet (36114) | more than 6 years ago | (#23861719)

> I wish that someone would create a non-bloat version of the Java class libraries. Do an analysis
> of important use cases, redesigned the class libraries to be much less "fluffy"

Somebody did just this [python.org] already.

Re:Language Compatibility vs. Class Libraries (3, Informative)

Octorian (14086) | more than 6 years ago | (#23861843)

But at least its only a mountain :-)

I don't know if Mono can ever catch up to the whole mountain range that .NET has bundled in. Especially since its taken far less seriously than Java by this community.

Re:Language Compatibility vs. Class Libraries (2, Interesting)

snoyberg (787126) | more than 6 years ago | (#23861945)

Why would remove features from the library make a program perform (significantly) better? Why not just avoid using those classes you consider bloated?

Re:Language Compatibility vs. Class Libraries (4, Insightful)

CastrTroy (595695) | more than 6 years ago | (#23862067)

I'm not sure how much more performance you could achieve simply by culling the unused stuff. Java already dynamically loads only the classes you use into memory. We have gotten to a point where people don't want to rewrite their own XML parsers, sorting algorithms, cryptography libraries, UI components, network connection handling functions, and all the other wonderful stuff provided by the .net and Java APIs. We're probably a lot better off because of it. Less time wasted writing code that someone has already written a million times. If you still want a smaller version of the JDK, there's always the Java Micro Edition Platform [sun.com] .

Re:Language Compatibility vs. Class Libraries (0)

Anonymous Coward | more than 6 years ago | (#23862087)

Who is stopping you? It is now open source so grab the source and do whatever you want with it. No one will use it because the class libraries make Java powerful, but you will have a nice lean system that only you will use.

Re:Language Compatibility vs. Class Libraries (2, Insightful)

DuckDodgers (541817) | more than 6 years ago | (#23862115)

Aren't you talking about a social problem, not a language problem?

Use the class libraries you like, build your own replacements for the ones you don't in Java itself or in C, and then (and here's the tricky part) convince the people you work with to only use your stuff.

Rewriting all of the class libraries to be more syntax consistent and intuitive would be fantastic - but you break so much backwards compatibility you might as well give up and adopt Groovy or Scala.

Re:Language Compatibility vs. Class Libraries (0, Troll)

mightybaldking (907279) | more than 6 years ago | (#23862141)

This is my favourite snippet that demonstrates the java bloat:
String xmlSystemId = new File(xmlFileName).toURL().toExternalForm( );
String xsltSystemId = new File(xsltFileName).toURL().toExternalForm( );
org.apache.xalan.xslt.XSLTProcessor processor = org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor( );
org.apache.xalan.xslt.XSLTInputSource xmlInputSource = new org.apache.xalan.xslt.XSLTInputSource(xmlSystemId);
org.apache.xalan.xslt.XSLTInputSource xsltInputSource = new org.apache.xalan.xslt.XSLTInputSource(xsltSystemId);
org.apache.xalan.xslt.XSLTResultTarget resultTree = new org.apache.xalan.xslt.XSLTResultTarget(System.out);
processor.process(xmlInputSource, xsltInputSource, resultTree);
When what I need is:
XMLTransformer.transform(xmlfile, xsltFile, outputStream)
which should be a static method.

Re:Language Compatibility vs. Class Libraries (5, Informative)

AKAImBatman (238306) | more than 6 years ago | (#23862503)

Source source = new StreamSource(new File(xmlFileName));
Result result = new StreamResult(new File(xsltFileName));
 
TransformerFactory.newTransformer().transform(source, result);
Was that really so hard?

If the code you posted is the best obfuscated Java code you can come up with, then I'm impressed. I've seen MUCH worse Perl, C, and even Python. Your code was at least understandable (albeit unnecessarily obtuse), thus demonstrating the unexpected readability advantages of the Java language.

P.S. Import statements are your friend.

Re:Language Compatibility vs. Class Libraries (1)

VGPowerlord (621254) | more than 6 years ago | (#23862553)

Last time I checked, Xalan [apache.org] wasn't part of the Java standard library. You'll have to take this one up with Apache.

And if you think that's bad, take a POJO and run it through Apache Axis2's Java2WDSL then that WDSL through WDSL2Java to generate the client. The generated client code is huge, somewhere in the 2-3k line range.

Re:Language Compatibility vs. Class Libraries (1)

hattig (47930) | more than 6 years ago | (#23863343)

Say "Yay" for SOAP sadly. I haven't used Axis 2, only Axis 1.0 and 1.4 though, but the generated files do have quite a bit of syntactic bloat to them. Shame that the Axis code generator hasn't learned of auto-generating imports either.

People, just use REST, okay? In Java you just include HTTP Client, and it's a few lines of code, assuming you have Java->XML and XML->Java code written already (efficient StringBuilders and SAXParsers respectfully, rather than lots of Introspection within the SOAP/Axis libraries). Yeah, it takes longer, but you run a timer against the same thing implemented as REST versus SOAP.

Sadly, when you're told to write an interface to a third-party web service, you have no choice, and you have one day to do it in, so the wsdl2java + utility class to map values to/from your data structure is a really quick and reliable way to do things.

Re:Language Compatibility vs. Class Libraries (1)

deraj123 (1225722) | more than 6 years ago | (#23862895)

Transformer transformer = TransformerFactory.newTransformer(new StreamSource(new File(xsltFileName)));
transformer.transform(new StreamSource(new File(xmlFileName)), new StreamResult(outputStream));

It's 2 lines, not your 1. However, what you call bloat, I call flexibility (well, and a little bit of either ignorance or deliberate misinformation - there is seldom any good reason to include the entire package name - use import statements).

When what I need is:
XMLTransformer.transform(xmlfile, xsltFile, outputStream)
which should be a static method.

This is what we call a special case. I seldom have the need to do this particular operation. If you have to do it a lot, you can write a static method in 4 lines.

Also, I should point out that "org.apache.xalan.xslt" is hardly the Java API.

Re:Language Compatibility vs. Class Libraries (1)

lorenzo.boccaccia (1263310) | more than 6 years ago | (#23862901)

you're doing it quite wrong. from the java documentation examples: //create the factory, for caching purpose this is NOT static, nor it should be. TransformerFactory tFactory = TransformerFactory.newInstance(); //set the style sheet Transformer transformer = tFactory.newTransformer(new StreamSource("stocks.xsl")); //start transformations. transformer.transform(new StreamSource("stocks.xml"),new StreamResult(new FileOutputStream("stocks.html"))); and, if you need it to be static and global, put it on a separate XMLUtils class.

Re:Language Compatibility vs. Class Libraries (2, Insightful)

Moebius Loop (135536) | more than 6 years ago | (#23863061)

Oh come on. Java is definitely quite verbose, but no one would ever write that code like that.

This code example wouldn't even compile, these classes don't exist in any version of xalan.xslt that I can find, and it's not even using import statements.

import org.apache.xalan.xslt.*;

String xmlSystemId = new File(xmlFileName).toURL().toExternalForm( );
String xsltSystemId = new File(xsltFileName).toURL().toExternalForm( );

XSLTProcessor processor = new XSLTProcessorFactory().getProcessor( );
XSLTInputSource xmlInputSource = new XSLTInputSource(xmlSystemId);
XSLTInputSource xsltInputSource = new XSLTInputSource(xsltSystemId);
XSLTResultTarget resultTree = new XSLTResultTarget(System.out);
processor.process(xmlInputSource, xsltInputSource, resultTree);

And claiming that you ought to be able to do the following:

XMLTransformer.transform(xmlfile, xsltFile, outputStream)

Okay, so with your version:

  1. You can't transform XML that isn't stored in the local filesystem
  2. You can't apply any kind of preferences to the processor
  3. If you wanted to process multiple documents, you'd have no factory to instantiate/set common objects and attributes

And surely a million other things. You must realize that in this day and age people are using XML and XSLT for myriad different uses, and a proper toolkit should be able to handle as many of them as possible.

That's the best and the worst part about almost every Java library that people love to complain about. Swing gets much of this, but when you want a platform-agnostic way to put that essential UI component in the lower right-hand rectangle made by the scrollbars on your JScrollPane, Swing is the only way you're going to get there (or maybe SWT, I've never used it, but I hear similar complaints and praise).

Java is the only platform-independent language that has this kind of power in the core library. Furthermore, this announcement means we've now got an true open-source environment that is already making inroads in the business programming world, in areas that have been previously dominated by C/C++ and (shudder) VB. This is a good thing.

-phil

Re:Language Compatibility vs. Class Libraries (1)

Abcd1234 (188840) | more than 6 years ago | (#23863157)

Wow... a single example from a third party library. And then you used explicit namespaces instead of importing them, to make it look more complex than it really is. Sheer brilliance. You've sure convinced me!

That you don't know anything about software development, that is.

Re:Language Compatibility vs. Class Libraries (1)

ndansmith (582590) | more than 6 years ago | (#23862167)

I wish that someone would create a non-bloat version of the Java class libraries. Do an analysis of important use cases, redesigned the class libraries to be much less "fluffy" and then post some metrics to show how much better it performs.
Have it on my desk Monday morning.

Re:Language Compatibility vs. Class Libraries (0)

cecom (698048) | more than 6 years ago | (#23862357)

In fact Java the language is absurdly primitive. The culmination of cut & paste. It is the libraries that make it bearable.

Re:Language Compatibility vs. Class Libraries (5, Insightful)

Anonymous Coward | more than 6 years ago | (#23862593)

And as examples of bloat, you had to pick Swing, NIO and logging?!?

Logging is a quasi-identical to Apache's log4j, indeed this caused bad feelings among log4j's authors who felt Sun should just have officialized their API. Of course the reason Sun used it as an (ahem) inspiration is that it's very good, as demonstrated by the absolutely huge number of projects using it. And you know as well as I do that rolling out your own is a common developer trait, *especially* for trivial things like that.

NIO is brilliant. If it's too complex or low-level for you, just use the "old IO", which is *also* good - just not as low-level.

Swing, I can understand your feeling. Although the real problem with Swing is not "bloat" as in unnecessary complex and featurefull, it's that even though it only shipped in a JDK with 1.2 (which had the Collection framework), Sun bowed to short-sighted morons who kicked a fuss when it was suggested that it be put in java.swing (instead of javax.swing), and as a result still uses the old Vector and so on.

Generally speaking, what you call "bloat" is due to:
- the presence of libraries *you* don't use. Guess what, other people do.
- the provision for extensions. For instance, the java.net package is chock full of factories, abstract classes and interfaces that you seem to disdain. And indeed to 98% of developers who just use it for the net, that's all pretty pointless. The upshot is that should you require Unix or X25 sockets, you can still use the same API - I've seen it done. Sure you have to write the C code, but the Java code is all the same except the bit that gets the address. How many open-source language don't even have a common low-level DB API, forcing you to write you own single use abstraction layer when you need to target several DBs? At least with Java you know it's JDBC. Always.

Sun's attitude towards libraries has always been, as far as Java is concerned at least, make the simple easy, make the difficult possible. To me that's good design. Of course it means that easy can be more complex than with more specific APIs. But those tend to not allow the difficult at all :-(

Re:Language Compatibility vs. Class Libraries (0)

Anonymous Coward | more than 6 years ago | (#23863409)

They have. IBM's J9.

Apple (4, Insightful)

thomas.galvin (551471) | more than 6 years ago | (#23861589)

Sweet. Maybe was can start getting Java VMs on the Mac less than a decade after they're released now.

Re:Apple (0)

Anonymous Coward | more than 6 years ago | (#23861773)

Sweet. Maybe was can start getting Java VMs on the Mac less than a decade after they're released now.
Ti's the nice thing about OpenJDK, there's actually an OSX port. People are trying to get it included as a support "platform" port so that developers don't have to wait for apple.

Re:Apple (1)

sm62704 (957197) | more than 6 years ago | (#23862343)

Now that it's open-source and Apple is UNIX-like you can do Java on Mac yourself.

Re:Apple (1)

Ilgaz (86384) | more than 6 years ago | (#23862705)

Cocoa/Core Audio/Integration with OS X Desktop and the rumours of Carbon future make it hard for everyone. Only company besides Apple to ship such a huge thing is Sun and it could get real pricey for them. They absolutely need to start hiring Cocoa/OS X programmers and start talks with Apple on future of Java on OS X.

I won't be surprised if Apple says "Java 6 will be Intel only" for example. Won't be surprised at all.

You know any handset which has higher price than $70 and doesn't have J2ME? Take a guess :)

Re:Apple (0)

Anonymous Coward | more than 6 years ago | (#23862529)

What's with all the drink codenames?

What do we get if we mix IceTea with Java and Cocoa with a drop of WINE on the rock made of Aqua?

Re:Apple (3, Insightful)

Ilgaz (86384) | more than 6 years ago | (#23862601)

Where were you past 3-4 months? :)

Landon Fuller and a team made Java 6 running under OS X X11 (and command line of course)

http://landonf.bikemonkey.org/static/soylatte/ [bikemonkey.org]

It is said to have great performance too.

The real issue is, how to make that gigantic thing available to PPC G5 and G4/G3 (if they accept perf. penalty) processors under OS X. X11 could be OK too. The Java 6 release(!) from Apple is Intel 64bit _only_. We can't ask Apple as they even abandoned Intel 32bit users (on that release) so there should be some team, likely from IBM needs to step in. They shipped Java 6 for Linux PPC/PPC64 ages ago. They should step in and save/support their CPU customers, especially G5. While people buy G5 workstations/servers, they also bought IBM CPUs.

Re:Apple (1)

thomas.galvin (551471) | more than 6 years ago | (#23863355)

I was in the corner, bitching about the fact that it took almost a decade to get Java 6 on the Mac. From a third party. Then, I was bitching about the fact that Apple decided to release the "official" Java 6, but limited it to 64 bit processors.

Ask Slashdot (1)

sm62704 (957197) | more than 6 years ago | (#23861641)

Six point three million lines of code??? How is it possible for a language to need six point three milliion lines of code? Is this bloat, or are all six point thee million lines actually used?

The first iteration of Artificial Insanity (a smartassed Turing test program I wrote way back when I still gave a shit) was less than 16k of BASIC, but when I rewrote it with pretty much the same source code in Clipper for DOS, the executable was over 400k despite the fact that the source was still less than 16k.

The SOURCE for java is 6.3 megabytes? What is it written in, COBOL?

Re:Ask Slashdot (5, Informative)

The End Of Days (1243248) | more than 6 years ago | (#23861787)

Java the language and Java the platform are not at all the same thing. OpenJDK refers to an implementation of the platform, which includes the tools, the API, and the VM.

It's mostly written in Java (the language), by the way.

By the by, reading that first link made my brain hurt. When is GNU going to learn that the language of doom ("shackled," "trap," etc.) is a good way to ensure that you preach only to the choir?

Re:Ask Slashdot (2, Funny)

SanityInAnarchy (655584) | more than 6 years ago | (#23862039)

When is GNU going to learn that the language of doom ("shackled," "trap," etc.) is a good way to ensure that you preach only to the choir?
I suspect it'll be around the same time that Republicans learn that people care about more issues than the terrorists.

Re:Ask Slashdot (3, Insightful)

Jason Earl (1894) | more than 6 years ago | (#23862953)

By the by, reading that first link made my brain hurt. When is GNU going to learn that the language of doom ("shackled," "trap," etc.) is a good way to ensure that you preach only to the choir?

RMS has been talking that way for years. There's essentially no chance of him changing his ways at this point. This is especially true considering the fact that RMS' zealotry has netted him an impressive string of wins including a GPLed version of Java.

The fact of the matter is that the Free Software community has become a rather influential player in the software world. Sun GPLed Java because the executives at Sun finally realized that despite the huge push for Java from the "Enterprise" crowd, the real reason that Java was a competitive platform was because of the large quantity of Free Software that had grown up around Java. Sun needed Free Software hackers, but for the most part Free Software hackers weren't interested in working with Java.

In this particular case, preaching to the choir was precisely what was needed.

Re:Ask Slashdot (0)

Anonymous Coward | more than 6 years ago | (#23863015)

the real reason that Java was a competitive platform was because of the large quantity of Free Software that had grown up around Java. Sun needed Free Software hackers, but for the most part Free Software hackers weren't interested in working with Java.


Wanna try restating that in a way that doesn't contradict itself, there, zealot?

Re:Ask Slashdot (2, Informative)

Thiez (1281866) | more than 6 years ago | (#23861815)

Java comes with a huge library of classes. It seems that is was the article about. I'm sure you can write a working java interpreter in less than 6.3 million lines.

Re:Ask Slashdot (3, Insightful)

Anonymous Coward | more than 6 years ago | (#23861849)

That count includes the standard libraries. And it includes the *comments* in the standard libraries, from with the javadocs are generated. All in all, it sounds like a pretty reasonable number.

Re:Ask Slashdot (1)

Ilgaz (86384) | more than 6 years ago | (#23862769)

Java is not only a language, it is a virtual machine which should run anywhere with amazing levels of backwards compatibility.

What's the point? (4, Interesting)

jps25 (1286898) | more than 6 years ago | (#23861743)

Okay, so I understand that this is a huge success, yay GPL and all that, but what is wrong with Sun's JDK?
What makes the OpenJDK more desirable than Sun's?
Is it merely the GPL?
Are there any performance gains?
I don't use java, so I really have no idea and it would be nice if someone could enlighten me.

Re:What's the point? (3, Interesting)

Funks (661017) | more than 6 years ago | (#23861883)

Okay, so I understand that this is a huge success, yay GPL and all that, but what is wrong with Sun's JDK? What makes the OpenJDK more desirable than Sun's? Is it merely the GPL? Are there any performance gains? I don't use java, so I really have no idea and it would be nice if someone could enlighten me.
Trying using the Sun distributed JDK on FreeBSD, NetBSD and other micro architectures like MIPS. Moreover, being completely GPL - Linux distributions will be able to bundle it in. The BSD's will also benefit from this and won't be treated like a redheaded step-child anymore when selecting a JEE hosting platform. Note, RedHat is a big player in the Java (JEE) middleware industry. So basically, it was in their best interest to see this through.

Re:What's the point? (3, Informative)

Vectronic (1221470) | more than 6 years ago | (#23861949)

From what i understand, the advantage is that distributions that are (or try to be) 100% "Open Source" can now add this to their list.

Ontop of that, it means that anyone and their dog can dig through it, and maybe even improve on it, plus being able to make better java applications knowing exactly whats going on...

Re:What's the point? (0)

Anonymous Coward | more than 6 years ago | (#23862251)

Also, as mentioned elsewhere, they rewrote all the patent-encumbered stuff. The whole codebase is "free" now: this will allow third parties to create competing JDKs, and possibly usher in an era of very rapid improvement.

Re:What's the point? (1)

lytles (24756) | more than 6 years ago | (#23862827)

from my experience this is going to be very useful. i've come across several classes that do almost what i want, but not quite. the best example is sorting primitives, eg doubles, and wanting the sort order back. Arrays.sort() is a good algorithm, but the only way to get the order is convert all those primitives to Objects and sort the Objects - not fun. Having the source means that you're not starting from scratch - you've got a known working version, with known performance, and you can modify it. I had to hunt around and choose and algorithm and implement it.

And sorting is "easy", with hundreds of free references. For more complicated things that java does, this will be great.

Re:What's the point? (1)

mhamel (314503) | more than 6 years ago | (#23861963)

Well, that won't solve any performance issues. I'm an Ubuntu user. For me, it could change lot's of things. There are lot's of great java applications lying around. But in linux, they are often second class citizen. The reason is that the java envirenment can't but included simply with a distribution. You always have to go throught some hooplas. The reason it's not included is mostly because the jvm (java virtual machine) is not free in it's intelectual property. Now it just changed. So we can hope that some good java applications will have much better support soon in linux.

So for me it's a great thing.

Re:What's the point? (3, Interesting)

youngdev (1238812) | more than 6 years ago | (#23861987)

It is my understanding that all of core java would be based on the OpenJDK going forward. Basically OpenJDK is SunJDK6.999 beta. SunJDK 7 will be the openJDK and SunJDK >= version 7 will all be open(gpl?).

Someone please correct me if that is wrong.

Re:What's the point? (2, Informative)

sidnelson13 (1309391) | more than 6 years ago | (#23862173)

Of course, we can search for enlightenment ourselves!

OpenJDK FAQ [sun.com]

Cheers!

Re:What's the point? (2, Informative)

j79zlr (930600) | more than 6 years ago | (#23862693)

64-bit plugin for 64-bit browsers. For some strange reason Sun refuses to release one. The current icedtea plugin for my Gentoo amd64 install works about 50% of the time. Hopefully they can get that up to where it is more compatible

Re:What's the point? (1)

drinkypoo (153816) | more than 6 years ago | (#23862845)

My understanding is that if you use the OpenJDK, you gain access to variable-width text.

about time Sun (0, Troll)

sjwest (948274) | more than 6 years ago | (#23861745)

Dear Sun employees as a /. reader and Debian box user i am occasionally interested in the Freshmeat apps on the right hand side. When it says downloading jar i know it usually won't work. Yes I am lazy and wont download stuff from your website, untar it, click agree and hope that all the other working Java bits still work and i have got a handle on what ever your Sun marketing experts have named the jdk this week. It is a shame that the run everywhere on everything has been such a long time coming.

Re:about time Sun (1)

SanityInAnarchy (655584) | more than 6 years ago | (#23862169)

When I last installed it, it was actually pretty simple:

apt-get install sun-java6-jdk
Of course, it'd still ultimately do the same thing -- download a tarball, unpack it, and prompt me for a license agreement. But it wasn't really that much more difficult than it is now with openjdk-6-jdk.

Re:about time Sun (1)

sjwest (948274) | more than 6 years ago | (#23863089)

That is a channel/repo we don't have setup, i assume you have the Non-free channel your pulling down the .deb from.

Oh boy! (0, Troll)

croftj (2359) | more than 6 years ago | (#23862255)

Not only can I torment myself programming in Java, but I can do it freely! Thanks GNU!

Life sucks, then you have to program in Java and learn just how bad it can get!
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?
or Connect with...

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>