Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "AWT was loaded on first thread"



On Monday 21 March 2005 00.15, Rolf Howarth wrote:
 I am writing a C++ command line program (using CodeWarrior and the
 Mac OS X PowerPC Mach-O linker to create an executable) in which I
 want to invoke a Java VM.

 The class I'm trying to use indirectly uses AWT. It executes as
 expected if I run it using "java -cp ...", but if I run it from my
 program I get the following error:

Check java_swt binary in the Eclipse Application wrapper. They have solved the problem.

Regards,

Cyrill

No, don't spend time on java_swt.
java_swt only exists to start the Java VM on the main thread, because that's the place
where SWT runs the Carbon event loop. As a consequence, java_swt isn't compatible with AWT.


However, java_swt was modelled after the SimpleJavaLauncher example too,
we only had to remove the the additional thread.
In recent JVMs the same effect can be achieved with the option -XstartOnFirstThread


--andre
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >"AWT was loaded on first thread" (From: Rolf Howarth <email@hidden>)
 >Re: "AWT was loaded on first thread" (From: Cyrill Rüttimann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.