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?