Linked by Thom Holwerda on Wed 30th Apr 2008 13:04 UTC, submitted by someone
Mac OS X Back in 2007 when Apple released Mac OS X 10.5 Leopard, a much-heard criticism was the lack of support for Java 6. Leopard shipped with an older version of Java, 1.5, even though 1.6 had been released by Sun almost a year prior. Sun had already released Java 1.6 for Linux and Windows, but did not do so for Mac OS X, since Apple insists on developing their own version of Java, according to Sun. Now, 6 months later, Mac Java programmers can rejoice.
Thread beginning with comment 312115
To read all comments associated with this story, please click here.
Java rant...
by gpsnoopy on Wed 30th Apr 2008 14:14 UTC
Member since:

I'm currently working on a Java project on an embedded system. A bit annoyed by all the legacy code I have to work with, I'll start a small rant against Java to fight my boredom.

The news kinda reveals my biggest gripe against Java. For me it is not portable at all; at least, no more than other languages.

Most platforms feature at least a free decent C compiler. From there either you directly have a modern C++ compiler or you can compile a C++ compiler (i.e. GCC). Even on the embedded systems, it is quite rare not to be able to get a decent C++ compiler (although a lot of programmers in the embedded market tend to dismiss it, 'cause someone told them embedded programming had to be done in C).

Now, with Java, you're at the mercy of having a decent JVM for the relevant platforms. Of course, major platforms have access to a decent Java 6 VM, but it's far from being the case on more exotic platforms. Mind the news above: MacOS X had to wait a year to have access to Java 6, and it's only covering the latest 64 bits Intel CPUs! Personally, I don't think that MacOS X is such an exotic platform.

A lot of "exotic" platforms do have a JVM, but usually it's a decent Java 1.2 VM at best, or a quite slow and incomplete Java 1.1 VM at worst. Some programmers are happy with that, I'm not.

In the project I'm working on, they use JNI to interface the Java part with a C++ library doing the core work. While it makes sense from a technical point (the core part needs to be as fast and efficient, the target being an embedded system), it makes things even worse.

Not even talking about the 64 MB eaten up by the JVM (WTF?! 64 MB on an embedded device, just for a GUI ?!). The addition of a C++ library, combining Java and C++ portability shortcomings together, makes the portability of the whole project a nightmare.

I could also go on about all these Java development tools that, as if they were the only relevant Java application, install development tools or libraries that are incompatible with the rest of the system (Eclipse anyone ?)

A bored and annoyed developper.

PS. Yesterday, Eclipse (lastest stable version) crashed about 10 times the Sun JVM (also latest stable version) with some nice segfault. Although I recall someone telling me that segfaults were impossible in Java, I most certainly encountered way more Sun JVM crashes than I found critical bugs in C++ compilers (GCC and VS).

Reply Score: 3

RE: Java rant...
by collinm on Wed 30th Apr 2008 15:12 in reply to "Java rant..."
collinm Member since:

sun have a jvm for a lot of embedded system

also it's not the sun's job to create a jvm for all cpu...

sun provide an implementation... people can create a jvm if they want...

a lot of embdedded system use java to program... like muvium ( this system cpu is under 50Mhz...

don't forget java is a language...

if you find the jvm implementation you use, try to use another one... or try compagny who take the java code and convert it directly in c or asm...

you can try gcj... but for the majority of the test i done, it's slower than sun jvm

Reply Parent Score: 4

RE: Java rant...
by slashdev on Wed 30th Apr 2008 15:23 in reply to "Java rant..."
slashdev Member since:

I think it was Apple's choice not to have Java 1.6. Not Sun. Sun doesnt make a Java VM for Apple (or many other platforms). I think they support Linux/Windows and Solaris. From what i understand its up to Apple to develop and deploy Java on the Mac OS X platform.

Also, I am not sure what embedded system you are working with, but the J2ME works on lots of devices with as little as 5MB of RAM (some i suspect even less). If you are having to deal with JNI, it sounds like you are probably dealing with hardware that has no java library support. Thats not Java's Fault either (its like blaming language X for not having libraries for hardware Y, so you have to use an external interface to libraries written in language Z).

Java does not equal C. If you want C portability, use C. If you want Java's features, use Java. Or if you want the best of both worlds and your platform supports GNU GCC use Their GCJ compiler, and compile to native code and link to C/C++ libraries as needed. There are also more efficient VMs such as Kaffe.

BTW- i suggest if you are having problems with eclipse, use NetBeans. I have started using it for ruby development and its very nice.

Reply Parent Score: 7

RE: Java rant...
by bproven2 on Wed 30th Apr 2008 15:45 in reply to "Java rant..."
bproven2 Member since:

I think the worse evil is the fact that we don't get this for Tiger... ;)

Reply Parent Score: 4

RE[2]: Java rant...
by bousozoku on Wed 30th Apr 2008 19:01 in reply to "RE: Java rant..."
bousozoku Member since:

I think the worse evil is the fact that we don't get this for Tiger... ;)

Java 6 GM has been available for Tiger since late 2007, hasn't it?

They even mention it in this support note:

I'm not even sure that Apple have updated Java 5 for Leopard with the latest fixes but it's been a long time since I loaded Java 6 onto my Ubuntu and Windows machines.

For a company that said that Mac OS X was the best platform ever for Java, it's time for them to eat their words.

Reply Parent Score: 5