[Qt-jambi-interest] -XstartOnFirstThread & mac

Gunnar Sletta gunnar at trolltech.com
Tue Aug 11 08:43:16 CEST 2009


Matt. C. wrote:
> 
> Yep, OS X version 10.5.8 64bit
> 
> I'm using the standard 32bit java 1.5 that comes with OSX
> 
> java version "1.5.0_19"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
> Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)

I'm on 1.5.0_16 using OSX 10.4, so I guess one of those is the difference.

> So, after downloading qtjambi I ran qtjambi.sh and it crashed 
> immediately. I see the message so pop open qtjambi.sh and change the 
> second to last line to
 >
:
> java -XstartOnFirstThread -cp $CP com.trolltech.launcher.Launcher
> 
> Then the demos ran great, no issues, but the message remained.
> 
> The problem seems to only occur of the main class inherits from 
> QWidget/QObject. For example, this prints no warning:

This would indicate that the classloader is not running on the main 
thread even though you specify -XstartOnFirstThread as an option. I'll 
investigate putting the check in QApplication.initialize instead.

If you build from source you can disable the check. It is located in 
qtjambi/qtjambi_functions.cpp, just look for pthread in the file. There 
is no way to disable this message from the binary package, I'm afraid.


> public class HelloWorld
> 
>     public static void main(String args[])
>     {
>         QApplication.initialize(args);
> 
>         QPushButton hello = new QPushButton("Hello World!");
>         hello.resize(120, 40);
>         hello.setWindowTitle("Hello World");
>         hello.show();
> 
>         QApplication.exec();
>     }
> }
> 
> But this prints a warning with -XstartOnFirstThread.
> 
> public class HelloWorld extends QPushButton
> {
>     public static void main(String args[])
>     {
>         QApplication.initialize(args);
> 
>         QPushButton hello = new HelloWorld("Hello World!");
>         hello.resize(120, 40);
>         hello.setWindowTitle("Hello World");
>         hello.show();
> 
>         QApplication.exec();
>     }
>    
>     public HelloWorld(String name) {
>         this.setText(name);
>     }
> }
> 
> Hope that helps.
> 
> 




More information about the Qt-jambi-interest mailing list