🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.mac.programmer.codewarrior
3 messages
3 total messages Started by jahhaj Fri, 02 Dec 2005 12:36
can't start AWT
#91
Author: jahhaj
Date: Fri, 02 Dec 2005 12:36
16 lines
1776 bytes
I'm trying to start a 1.4.2 Java VM from a Mac OS X Mach-O application
using JNI_CreateJavaVM. I get the following error

Apple AWT Java VM was loaded on first thread -- can't start AWT

Seems a few people have had this problem but the suggested answers
don't work for me, in particular I've made sure that I don't have
StartOnFirstThread specified in my application info.plist (why would it
be there in any case?).

I'm working with CodeWarrior 9, although testing on XCode produces a
similar problem so I don't think it is compiler specific.

I'm stuck so any input at all would be welcome.

john
Re: can't start AWT
#92
Author: jahhaj
Date: Fri, 02 Dec 2005 15:09
2 lines
1398 bytes
OK, the answer is bleeding obvious. You must create a second thread and
call JNI_CreateJavaVM from that.
Re: can't start AWT
#93
Author: Greg
Date: Sat, 03 Dec 2005 20:31
12 lines
1764 bytes
jahhaj wrote:
> OK, the answer is bleeding obvious. You must create a second thread and
> call JNI_CreateJavaVM from that.

As a former java on Mac OS X engineer, I would highly suggest that you
try to have java start up the program that will then load your native
code.

Having your native code start java that in turn starts up AWT is a
hassle, as I believe you are only starting to find out...

-Greg
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads