Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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)
share|improve this question
    
Is it Sun/Oracle or OpenJDK? –  yossile Mar 21 '12 at 19:14
add comment

2 Answers

up vote 1 down vote accepted

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).

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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