Re: JavaBridge
Re: JavaBridge
- Subject: Re: JavaBridge
- From: Andy Belk <email@hidden>
- Date: Tue, 4 Dec 2001 11:05:42 -0800
Hi Julien,
Is it just me or isn't JavaBridge really working???
Definitely just you ;-)
I'm trying to do my "first, not too big, not too complex cocoa
application" using Java.
Since it's your first Cocoa Java app, it could possibly be that
you are missing some small, subtle yet required piece of code,
or something like that. CocoaJava is not perfectly transparent
to the Java programmer - there are some idioms that don't map
exactly into Java (categories) and vice-versa (delegates should
technically be weak references, but Objective-C has no explicit
notion of that) and some code you need to use that you don't in
Swing (AutoreleasePools for one).
However, it looks like some disease is infecting the
application, causing:
- Lots of segfaults/bus errors.
- Unexpected exceptions and errors, like AbstractMethodError
(yes I cleaned and rebuild the target... one hundred times...),
NullPointerException (from affected final members...)...
- And my favorite one:
jobjc_lookupObjCObject(): returning garbage collected java ref
for objc object of class XXX
Obviously, those bugs are completely random, they are frequent,
but really "reproducible" (I nevertheless found some method: Do
some action once. If the app does not crash, do it again...).
So, have I become completely incompetent?
I very much doubt it.
Has someone met the same problems?
We haven't heard of any specific problems, but you may have hit
something new if you are using API that's not exercised
sufficiently by our testing.
Has someone successfully accomplished a full, working, stable
Cocoa-Java application?
BlastApp and TextEdit (in /Developer/Examples/Java/AppKit) are
fairly extensive examples.
Has someone some magical incantation that will save me from ObjectiveC?
You should be able to write a functional Cocoa app using Java.
My advice would be to take one of the existing examples and try
to extend it to do something of what you want to see if you can
do part of what you want, then try to see the differences
between the functioning example and your problematic
experiment ;-)
You could also write the same app in Objective-C and it would
(likely) be smaller and faster, because there's not the overhead
of both runtimes.
Also, if you want the Aqua look and feel, but want to write in
Java, you can also write using Swing.
An answer from JavaBridge team would be greatly appreciated to
clarify the situation (please, tell me: "Yes, those symptoms
are induced by some horrible bugs, but don't worry, next OS X
release will fix them all!!!"). I just want to be able to work.
Hope this helps,
Andy Belk
iEngineer, Java Runtime, Apple.
References: | |
| >JavaBridge (From: Julien Dufour <email@hidden>) |