3

I'm writing a Java app and the GUI is extremely slow on my Ubuntu 11.10 64bit setup. It takes a few seconds to respond to some action. It runs flawlessly on both Max OS X and Windows 7, it actually works just fine on a fresh Ubuntu 11.10(both 32 and 64bit) VirtualBox running on Win7.

I have already tried three different Java versions and it didn't help. What could be the problem?

Current Java version:

java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
  • Is it Sun/Oracle or OpenJDK? – yossile Mar 21 '12 at 19:14
2

You might want to try installing version 1.7 (oracle's one, not openjdk), and making sure it is the active version using update-alternatives and java -version.

Do note, however, that java is NOT a fast technology. Your applications are compiled to intermediate bytecode which needs to be interpreted by a fairly heavy application called the JVM. Although I don't remember ever having experienced multiple seconds of interface lag, I do know the GUI's written in java tend to be slow.

I've never noticed any difference between windows 7 and ubuntu/opensuse though (each 64-bit), but that might be due to the version: I always get the latest official java sdk (that is, from Oracle).

--

Although this might not be the answer you'd like to hear, if you don't explicitely need java (which you would if you were targetting mobile devices, I suppose) and/or if performance is important for your application, you might want to look for a native-compiled alternative. C++ with Qt would be an excellent alternative, if you're familiar with C++. It keeps your application cross-platform, without affecting the general performance.

Mono/C# comes with an option to precompile the bytecode, so you basicly have a native executable with the mono runtime included (heavy at startup, but faster than java at runtime).

| improve this answer | |
  • I had this problem also, but installing Oracle Java did NOT fix the problem. I think Solerma's answer about it being a driver issue could be a good lead for many others with this problem. – drwatsoncode Oct 10 '17 at 18:04
1

By your description, I would be it's a video driver issue. Looks for performance related issues regarding your video card in ubuntu. Inside a VM, ubuntu uses a VM-specific driver that have nothing in common with the hardware

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.