Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 5602  / 2 Years ago, wed, december 15, 2021, 11:55:01

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)

More From » java

 Answers
7

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


[#40158] Friday, December 17, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
repend

Total Points: 195
Total Questions: 113
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
3 Years ago
repend questions
Thu, May 11, 23, 09:38, 1 Year ago
Thu, Jan 5, 23, 21:41, 1 Year ago
Mon, Nov 22, 21, 19:37, 3 Years ago
Mon, Jan 24, 22, 11:26, 2 Years ago
;