[Qt-jambi-interest] -XstartOnFirstThread & mac
Matt. C.
yougotrooted at gmail.com
Tue Aug 11 07:54:57 CEST 2009
On Mon, Aug 10, 2009 at 10:26 PM, Gunnar Sletta <gunnar at trolltech.com>wrote:
> Matt. C. wrote:
>
>> When I run the qtjambi examples (4.5.2) I get this warning message:
>>
>> "Qt Jambi does not appear to be running on the main thread and will most
>> likely be unstable and crash. Please make sure to launch your 'java' command
>> with the '-XstartOnFirstThread' command line option."
>>
>> The examples are also very unstable.
>>
>> When I add -XstartOnFirstThread, I get this warning message:
>>
>> "Qt Jambi does not appear to be running on the main thread and will most
>> likely be unstable and crash. Please make sure to launch your 'java' command
>> with the '-XstartOnFirstThread' command line option."
>>
>
> Hi Matt,
>
> We added the warning for this release. Previously, Qt Jambi on mac would
> just be unstable and crash if the command line option was omitted. On my mac
> the message goes away when I enable the thread option.
>
> Do you have some more specs on your system? Java version, OS version etc?
>
> -
> Gunnar
>
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)
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:
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-jambi-interest/attachments/20090810/26755882/attachment.html
More information about the Qt-jambi-interest
mailing list