And We Thought Java was the Same Everywhere!

Java. It’s that old language that runs code in a highly bloated virtual machine at slow speeds and terrible performance, especially on the Web. On a local PC, a Java’s just pure slow, but on the web Java can be a real headache. However, it has its benefits too — or so we thought. There are only two reasons someone would use Java in a website today: they wanted to write a complex program/script really quick and they needed it to just work regardless of browser or platform. After all, Java is Java, no matter if you’re on Windows, Linux, or Mac; or use Firefox, Opera, or even Internet Explorer… But it’s not!

First, to clarify: this isn’t an article about Java, and it especially isn’t an attack on Java, not today. This is about Opera 9, the wonderful and highly-innovative browser that can do anything and everything with less memory than its competitors and with much less time too. But it breaks Java.

The reason isn’t clear, because unlike older versions of Opera, Opera 9 doesn’t have its own special version of Java or use it in a ‘broken’ way. The extent of Opera’s innovation in this field with Opera 9 is interfacing directly with Java — unlike all other browsers it doesn’t need a plug-in to connect to the JRE, instead it finds the executable files on its own and embeds them in a browser window.

If all what Opera does is run the JAR on its own, then simply stick it into the browser, there is no reason anything should go wrong. Its fairly straight-forward, but apparently something is wrong.

The particular manifestation of this bug is something we’re experiencing with our Gallery which has a script used to modify and crop the thumbnails used for our pictures. It has a movable box to select the area visible in the thumbnails, and in the bottom-right corner of this box is an anchor that can be used to re-size the box.

In Firefox, Safari, Netscape, and Internet Explorer, it works great:
How it looks on Bon Echo & IE7

But in Opera, moving the box resizes it, and resizing it locks it from moving; and no matter how are you try, you can’t get the box to span the entire image.
Messed-up resizing on Opera

The interesting thing is, Opera is the only one that displays the picture correctly without the pixelization, yet it alone can’t re-size the right way. In the other browsers you have the grey translucent shadow, but in Opera it’s missing.

All this brings us to the question: whose fault is it? Does Opera incorrectly use the JRE, or is the JRE actually platform-dependant, but for the ‘compatibility layer’ presented in the plug-in? Why does this happen with Opera alone? And most importantly: with AJAX and Flash, is Java dead?

7 thoughts on “And We Thought Java was the Same Everywhere!

  1. Nope – not in a million years.

    Can’t remember the source, but the top online language was PHP, and offline is C .
    Java has been on the decline in terms of true usage for years, and is usually used only certain Windows open source projects, while most other OSS software is in C, and the great majority of all commercial/business applications are in C .

    Look at the facts: the official libraries for the big stuff (Windows API, Wine, DirectX, OpenAL, network stacks, basically anything that you would use to code) is in C .

    At best, Java is used to create proprietary solutions to framework-less applications — for instance if you want to use existing programs/command-line scripts and a GUI to it, or anywhere where you aren’t technically coding the libraries themselves in Java, it’s an OK language and the easiest (well.. now that there is J# and C# that’s debatable) to use – but if you have to write/use libraries directly, it’ll result in more work.

    The most important thing to look at on that ‘index’ is the source of the info: namely, the ‘professionals’ in those fields. That’s a very biased look at the languages, Java is required learning material for any college or university, and it’s easier than the other language: C. Java is everyone’s strong language, but that doesn’t make it the language of applications today.

Leave a Reply

Your email address will not be published. Required fields are marked *