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: JNI without XCode?



Chris Adamson <email@hidden> wrote:
> Is anyone doing JNI without XCode?

yes.

> I appreciate that it's convenient to let XCode drive, and Apple's
> sample works just fine, but I want to keep my build command-line
> driven so it'll work on Windows too.

if you download the stupidly-named "salma-hayek" library from my home
page, you'll find a make(1) file that can build for Linux, Mac OS, and MS
Windows.

(if you're prepared to put your Java source in a directory called 'src',
and your JNI code in a directory called 'native/all' (if it's portable)
or, say, 'native/Darwin' (if it's Darwin-only), you'll be able to use the
rules to build your own projects without modification.)

even better, if you're interested, salma-hayek includes a program called
javahpp -- analogous to javah(1) -- that generates rather nice C++ classes
for you to implement, and a few header files to give you a nicer C++
interface than Sun's JNI C API.

javahpp actually made JNI sufficiently pleasant that i'm surprisingly keen
to do some more. i wonder if Sun made their JNI API and tools so grungy
specifically to convince people it's best avoided?

if you also download the similarly badly-named "terminator" project,
you'll find an example that uses all of this stuff. (Terminator's JNI code
won't actually work on MS Windows because it uses cygwin, and cygwin and
the Sun JVM don't get on. but if all you care about is how to build, "make
-n" or reading the make rules is probably all you need.)

-- 
Elliott Hughes, http://www.jessies.org/~enh/

 _______________________________________________
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



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.